]> git.ipfire.org Git - thirdparty/pdns.git/commit
rec: Copy the negative cache entry before validating it 9262/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 17 Jun 2020 12:49:55 +0000 (14:49 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 19 Jun 2020 08:32:14 +0000 (10:32 +0200)
commitc474335fbda97bb8c422ac2af31bbb34ec00db54
treefcaec86a704db2c6998e48fcee6c4a2333229671
parent16820e8f9c4be2601bf2411f5de0e8685d19d912
rec: Copy the negative cache entry before validating it

Otherwise, in the unlikely case that:
- we need to go to the network in order to validate, for example to
  get or a DNSKEY ;
- the negative cache cleaning is run at that exact moment ;
- and the entry we have a pointer to gets wiped during that cleanup

we might trigger a heap-based use-after-free (read), possibly leading
to a crash if the memory has been reused already.
pdns/syncres.cc
pdns/syncres.hh