bind9/tests/isc
Aram Sargsyan 0a48252b53 Fix a data race in isc_task_purgeevent()
When isc_task_purgeevent() is called for and 'event', the event, in
the meanwhile, could in theory get processed, unlinked, and freed.
So when the function then operates on the 'event', it causes a
segmentation fault.

The only place where isc_task_purgeevent() is called is from
timer_purge().

In order to resolve the data race, call isc_task_purgeevent() inside
the 'timer->lock' locked block, so that timerevent_destroy() won't
be able to destroy the event if it was processed in the meanwhile,
before isc_task_purgeevent() had a chance to purge it.

In order to be able to do that, move the responsibility of calling
isc_event_free() (upon a successful purge) out from the
isc_task_purgeevent() function to its caller instead, so that it can
be called outside of the timer->lock locked block.
2024-05-17 12:08:27 +00:00
..
testdata/file Move all the unit tests to /tests/<libname>/ 2022-05-31 12:06:00 +02:00
aes_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:36:03 +02:00
buffer_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:36:03 +02:00
counter_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:36:03 +02:00
crc64_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:36:03 +02:00
doh_test.c unit tests: include an OpenSSL header before including cmocka.h 2023-04-14 12:40:14 +00:00
errno_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:36:03 +02:00
file_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:36:03 +02:00
hash_test.c Move all the unit tests to /tests/<libname>/ 2022-05-31 12:06:00 +02:00
heap_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:36:03 +02:00
hmac_test.c NetBSD has added 'hmac' to libc so rename our uses of hmac 2023-12-14 11:14:04 +11:00
ht_test.c Fix case insensitive matching in isc_ht hash table implementation 2024-02-11 11:23:28 +01:00
lex_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:36:03 +02:00
Makefile.am Add tests/isc/uv_wrap.h to Makefile.am 2022-06-01 17:45:34 +02:00
md_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:36:03 +02:00
mem_test.c Move all the unit tests to /tests/<libname>/ 2022-05-31 12:06:00 +02:00
netaddr_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:36:03 +02:00
netmgr_test.c Fix building netmgr_test with DoH disable 2024-04-29 16:59:26 +03:00
parse_test.c Move all the unit tests to /tests/<libname>/ 2022-05-31 12:06:00 +02:00
pool_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:36:03 +02:00
quota_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:36:03 +02:00
radix_test.c Add regression test for [GL # 4090] 2023-05-29 13:27:51 +10:00
random_test.c Update sources to Clang 15 formatting 2022-11-29 09:14:07 +01:00
regex_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:36:03 +02:00
result_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:36:03 +02:00
safe_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:36:03 +02:00
siphash_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:36:03 +02:00
sockaddr_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:36:03 +02:00
stats_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:36:03 +02:00
symtab_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:36:03 +02:00
task_test.c Fix a data race in isc_task_purgeevent() 2024-05-17 12:08:27 +00:00
taskpool_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:36:03 +02:00
time_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:36:03 +02:00
timer_test.c Don't use reference counting in isc_timer unit 2023-01-18 22:39:26 +01:00
uv_wrap.h Move all the unit tests to /tests/<libname>/ 2022-05-31 12:06:00 +02:00