2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 22:45:39 +00:00

Merge branch '4328-tasn-error-in-isc_hashmap_iter_create' into 'main'

Resolve "ThreadSanitizer: data race in dns_tsigkeyring_dump"

Closes #4328

See merge request isc-projects/bind9!8473
This commit is contained in:
Arаm Sаrgsyаn
2023-11-13 13:33:38 +00:00
2 changed files with 4 additions and 0 deletions

View File

@@ -1,3 +1,5 @@
6281. [bug] Fix a data race in dns_tsigkeyring_dump(). [GL #4328]
6280. [bug] Fix missing newlines in the output of "rndc nta -dump". 6280. [bug] Fix missing newlines in the output of "rndc nta -dump".
[GL !8454] [GL !8454]

View File

@@ -469,6 +469,7 @@ dns_tsigkeyring_dump(dns_tsigkeyring_t *ring, FILE *fp) {
REQUIRE(VALID_TSIGKEYRING(ring)); REQUIRE(VALID_TSIGKEYRING(ring));
RWLOCK(&ring->lock, isc_rwlocktype_read);
isc_hashmap_iter_create(ring->keys, &it); isc_hashmap_iter_create(ring->keys, &it);
for (result = isc_hashmap_iter_first(it); result == ISC_R_SUCCESS; for (result = isc_hashmap_iter_first(it); result == ISC_R_SUCCESS;
result = isc_hashmap_iter_next(it)) result = isc_hashmap_iter_next(it))
@@ -482,6 +483,7 @@ dns_tsigkeyring_dump(dns_tsigkeyring_t *ring, FILE *fp) {
} }
} }
isc_hashmap_iter_destroy(&it); isc_hashmap_iter_destroy(&it);
RWUNLOCK(&ring->lock, isc_rwlocktype_read);
return (found ? ISC_R_SUCCESS : ISC_R_NOTFOUND); return (found ? ISC_R_SUCCESS : ISC_R_NOTFOUND);
} }