2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

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.)
This commit is contained in:
Evan Hunt
2022-08-11 15:06:34 -07:00
parent 86c0241376
commit e79be4bd8a

View File

@@ -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);
}
}