bind9/lib
Ondřej Surý 4d465f4fa5 Dispatch ratelimiter events under the lock
isc__ratelimiter_tick() and isc_ratelimiter_shutdown() each pulled
events out of rl->pending into a function-local list, dropped the
mutex, and then iterated.  ISC_LIST_APPEND leaves the link in the
LINKED state, so a concurrent isc_ratelimiter_dequeue() saw an
event as still queued, called ISC_LIST_UNLINK against rl->pending —
which patched the prev/next of the local list — and freed the
event before dispatch finished, producing either an INSIST in the
unlink macro or a use-after-free in the dispatch loop.

isc_async_run() is a non-blocking wfcq enqueue, so there is no
benefit to dropping the mutex around it.  Unlink each event and
hand it to isc_async_run() while still holding rl->lock; the
existing ISC_LINK_LINKED check in dequeue then correctly
distinguishes "still queued and cancellable" from "already taken".

Assisted-by: Claude:claude-opus-4-7
2026-04-30 10:16:32 +02:00
..
dns Size HMAC key generation buffers to the maximum block size 2026-04-29 19:21:20 +02:00
isc Dispatch ratelimiter events under the lock 2026-04-30 10:16:32 +02:00
isccc switch isc_md_type_t to a proper enum 2026-02-02 11:12:55 +03:00
isccfg Fix a bug with template filename reuse 2026-04-14 21:50:31 -07:00
ns Fix swapped arguments in redirect2() single-label branch 2026-04-29 21:46:27 +02:00
.gitignore The isc/platform.h header has been completely removed 2021-07-06 05:33:48 +00:00
meson.build replace the build system with meson 2025-06-11 10:30:12 +03:00