]> 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:32:15 +0000 (13:32 +0200)
commita6f53d47b2253a04a9875e889c2bcd95bf70f10e
treec749bc1567edb63a93c904551d6db8c5a60f7ac2
parente249148d75950ec11d6716932b6fa3da8f12dcaf
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.
lib/dns/resolver.c