From: Ondřej Surý Date: Tue, 23 Sep 2025 09:17:53 +0000 (+0200) Subject: fix: dev: Fix datarace between unlocking fctx lock and shuttingdown fctx X-Git-Tag: v9.21.14~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2924f59cb3ec3a2c7a7b8dd9f6bbd106eb91a68a;p=thirdparty%2Fbind9.git fix: dev: Fix datarace between unlocking fctx lock and shuttingdown fctx There was a data race where new fetch response could be added to the fetch context after we unlock the fetch context and before we shut it down. This could cause assertion failure when fctx__done() was called with ISC_R_SUCCESS because there was originally no fetch response, but new fetch response without associated dataset was added before we had a chance to shutdown the fetch context. This manifested in the validated() callback, where cache_rrset() now returns ISC_R_SUCCESS instead of DNS_R_UNCHANGED when cache was not changed. However the data race was wrong on a general level. Add new argument to fctx__done() that allows to call it with fctx->lock already acquired to prevent these data races. Closes #5507 Merge branch '5507-dont-release-fctx-lock-on-done' into 'main' See merge request isc-projects/bind9!10961 --- 2924f59cb3ec3a2c7a7b8dd9f6bbd106eb91a68a