]> git.ipfire.org Git - thirdparty/pdns.git/commit
rec: Copy the negative cache entry before validating it 9261/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:46:20 +0000 (10:46 +0200)
commit938d491a8a82d35d77da3e50f0c57d8b3e0e7e06
treee61ce7d2e447239fc9f2f698057094c3556d5254
parentbe8daa1d4c21309131882dbde990598d9d20af59
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