diff --git a/CHANGES b/CHANGES index 504dc8e68b..7346da1f35 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +4552. [bug] Named could trigger a assertion when sending notify + messages. [RT #44019] + 4551. [test] Add system tests for integrity checks of MX and SRV records. [RT #43953] diff --git a/lib/isc/include/isc/event.h b/lib/isc/include/isc/event.h index 38206f53b9..4f757630af 100644 --- a/lib/isc/include/isc/event.h +++ b/lib/isc/include/isc/event.h @@ -41,7 +41,8 @@ typedef void (*isc_eventdestructor_t)(isc_event_t *); void * ev_sender; \ isc_eventdestructor_t ev_destroy; \ void * ev_destroy_arg; \ - ISC_LINK(ltype) ev_link + ISC_LINK(ltype) ev_link; \ + ISC_LINK(ltype) ev_ratelink; /*% * Attributes matching a mask of 0x000000ff are reserved for the task library's @@ -71,6 +72,7 @@ do { \ (event)->ev_destroy = (df); \ (event)->ev_destroy_arg = (da); \ ISC_LINK_INIT((event), ev_link); \ + ISC_LINK_INIT((event), ev_ratelink); \ } while (0) /*% diff --git a/lib/isc/ratelimiter.c b/lib/isc/ratelimiter.c index 96571e1ca4..dc3205d186 100644 --- a/lib/isc/ratelimiter.c +++ b/lib/isc/ratelimiter.c @@ -155,7 +155,7 @@ isc_ratelimiter_enqueue(isc_ratelimiter_t *rl, isc_task_t *task, rl->state == isc_ratelimiter_stalled) { ev->ev_sender = task; *eventp = NULL; - ISC_LIST_APPEND(rl->pending, ev, ev_link); + ISC_LIST_APPEND(rl->pending, ev, ev_ratelink); } else if (rl->state == isc_ratelimiter_idle) { result = isc_timer_reset(rl->timer, isc_timertype_ticker, NULL, &rl->interval, ISC_FALSE); @@ -181,8 +181,8 @@ isc_ratelimiter_dequeue(isc_ratelimiter_t *rl, isc_event_t *event) { REQUIRE(event != NULL); LOCK(&rl->lock); - if (ISC_LINK_LINKED(event, ev_link)) { - ISC_LIST_UNLINK(rl->pending, event, ev_link); + if (ISC_LINK_LINKED(event, ev_ratelink)) { + ISC_LIST_UNLINK(rl->pending, event, ev_ratelink); event->ev_sender = NULL; } else result = ISC_R_NOTFOUND; @@ -210,7 +210,7 @@ ratelimiter_tick(isc_task_t *task, isc_event_t *event) { /* * There is work to do. Let's do it after unlocking. */ - ISC_LIST_UNLINK(rl->pending, p, ev_link); + ISC_LIST_UNLINK(rl->pending, p, ev_ratelink); } else { /* * No work left to do. Stop the timer so that we don't @@ -244,7 +244,7 @@ isc_ratelimiter_shutdown(isc_ratelimiter_t *rl) { (void)isc_timer_reset(rl->timer, isc_timertype_inactive, NULL, NULL, ISC_FALSE); while ((ev = ISC_LIST_HEAD(rl->pending)) != NULL) { - ISC_LIST_UNLINK(rl->pending, ev, ev_link); + ISC_LIST_UNLINK(rl->pending, ev, ev_ratelink); ev->ev_attributes |= ISC_EVENTATTR_CANCELED; task = ev->ev_sender; isc_task_send(task, &ev); diff --git a/lib/isc/task.c b/lib/isc/task.c index 81785e9a83..2085f1967f 100644 --- a/lib/isc/task.c +++ b/lib/isc/task.c @@ -549,6 +549,7 @@ task_send(isc__task_t *task, isc_event_t **eventp) { REQUIRE(event != NULL); REQUIRE(event->ev_type > 0); REQUIRE(task->state != task_state_done); + REQUIRE(!ISC_LINK_LINKED(event, ev_ratelink)); XTRACE("task_send");