Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zebra: Temporarily block the execution of the rib_process function while the thread t_dplane is waiting to be scheduled. #15065

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions zebra/zebra_rib.c
Original file line number Diff line number Diff line change
Expand Up @@ -3228,11 +3228,16 @@ static wq_item_status meta_queue_process(struct work_queue *dummy, void *data)
/* Ensure there's room for more dataplane updates */
queue_limit = dplane_get_in_queue_limit();
queue_len = dplane_get_in_queue_len();
if (queue_len > queue_limit) {
if (IS_ZEBRA_DEBUG_RIB_DETAILED)
zlog_debug(
"rib queue: dplane queue len %u, limit %u, retrying",
queue_len, queue_limit);
if (queue_len > queue_limit || t_dplane) {
zice312963205 marked this conversation as resolved.
Show resolved Hide resolved
if (IS_ZEBRA_DEBUG_RIB_DETAILED) {
if (t_dplane)
zlog_debug(
"rib_process_dplane_results is running, retrying");
else
zlog_debug(
"rib queue: dplane queue len %u, limit %u, retrying",
queue_len, queue_limit);
}

/* Ensure that the meta-queue is actually enqueued */
if (work_queue_empty(zrouter.ribq))
Expand Down Expand Up @@ -4974,6 +4979,7 @@ static void rib_process_dplane_results(struct event *thread)
}

} while (1);
t_dplane = NULL;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, we can't just poke at these event pointers like this

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to clarify. Just setting the pointer to NULL doesn't actually stop the event from running. FRR has just lost all control to it at all. This is especially bad because if the event in question has pointers stored in it and then those pointers are freed we'll have use after free's because the rest of FRR assumes that the event pointer as NULL the event is not running. We've had too many crashes to allow this to get into the system again.


#ifdef HAVE_SCRIPTING
if (fs)
Expand Down
Loading