From: Evan Hunt Date: Thu, 11 Aug 2022 22:06:34 +0000 (-0700) Subject: Lock the address entry bucket when dumping ADB namehook X-Git-Tag: v9.19.5~41^2 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=e79be4bd8a5e4b390ccb0e875b5e213e727c58bb;p=thirdparty%2Fbind9.git Lock the address entry bucket when dumping ADB namehook When dumping an ADB address entry associated with a name, the name bucket lock was held, but the entry bucket lock was not; this could cause data races when other threads were updating address entry info. (These races are probably not operationally harmful, but they triggered TSAN error reports.) --- diff --git a/lib/dns/adb.c b/lib/dns/adb.c index 3ff149a7740..bca098f016e 100644 --- a/lib/dns/adb.c +++ b/lib/dns/adb.c @@ -2946,7 +2946,9 @@ print_namehook_list(FILE *f, const char *legend, dns_adb_t *adb, if (debug) { fprintf(f, ";\tHook(%s) %p\n", legend, nh); } + LOCK(&nh->entry->bucket->lock); dump_entry(f, adb, nh->entry, debug, now); + UNLOCK(&nh->entry->bucket->lock); } }