mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-27 20:25:55 -04: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:
parent
1f12e1de3a
commit
f841f545b7
1 changed files with 6 additions and 0 deletions
|
|
@ -3620,7 +3620,13 @@ print_namehook_list(FILE *f, const char *legend, dns_adb_t *adb,
|
|||
if (debug) {
|
||||
fprintf(f, ";\tHook(%s) %p\n", legend, nh);
|
||||
}
|
||||
#ifdef __SANITIZE_THREAD__
|
||||
LOCK(&adb->entrylocks[nh->entry->lock_bucket]);
|
||||
#endif
|
||||
dump_entry(f, adb, nh->entry, debug, now);
|
||||
#ifdef __SANITIZE_THREAD__
|
||||
UNLOCK(&adb->entrylocks[nh->entry->lock_bucket]);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue