]> git.ipfire.org Git - thirdparty/pdns.git/commit
rec: Copy the negative cache entry before validating it
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 17 Jun 2020 12:49:55 +0000 (14:49 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 17 Jun 2020 12:52:49 +0000 (14:52 +0200)
commitf7d35114ab4153d0456d893c8694a0e6afa7ea20
treedf43ec9ef0c132b8ede4d4dac2b4474e9d223985
parenta161449f908f20082f1130e9b867eda71c6fed08
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