]> git.ipfire.org Git - thirdparty/bind9.git/commit
Fix use-after-free in resolver SIG(0) async verification path
authorOndřej Surý <ondrej@isc.org>
Tue, 17 Mar 2026 03:45:16 +0000 (04:45 +0100)
committerMichał Kępień <michal@isc.org>
Thu, 7 May 2026 11:09:18 +0000 (13:09 +0200)
commit1222a2aa0522ce97b2f8749f8628b5aee1461ad4
tree4ac06fe4eb1928f093dbaf9b51417bb5e53abe22
parent06a0738b2bd48c0da847a55791d10dc0a8f32c93
Fix use-after-free in resolver SIG(0) async verification path

When a SIG(0)-signed response triggers async ECDSA verification via
dns_message_checksig_async(), the respctx_t holds a raw pointer to
the resquery_t. If the fetch context is shut down while verification
is in flight (e.g. due to recursive-clients quota exhaustion), the
query is destroyed and the callback dereferences a dangling pointer.

Take a reference on the resquery_t when initializing the respctx_t,
and release it in both cleanup paths. The query's own reference to
the fetch context keeps the fctx alive transitively.

(cherry picked from commit 5b58caf5a2cd39d57a51b7b0373bfbc4877a96f9)
lib/dns/resolver.c