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

lib: fix use after free in clear event cpu #17943

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eqvinox
Copy link
Contributor

@eqvinox eqvinox commented Jan 28, 2025

Freeing any item here means freeing someone's event->hist, leaving a dangling pointer there. Which will immediately be written to because we're executing in a CLI function under the vty_read event, whose event->hist is then updated.

Deallocating event->hist anywhere other than shutting down the whole event loop is a bad idea to begin with, just zero out the stats instead.

Fixes: #16419

Freeing any item here means freeing someone's `event->hist`, leaving a
dangling pointer there.  Which will immediately be written to because
we're executing in a CLI function under the `vty_read` event, whose
`event->hist` is then updated.

Deallocating `event->hist` anywhere other than shutting down the whole
event loop is a bad idea to begin with, just zero out the stats instead.

Fixes: FRRouting#16419
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Copy link
Member

@riw777 riw777 left a comment

Choose a reason for hiding this comment

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

looks good

@donaldsharp
Copy link
Member

ci:rerun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SIGABORT on clear thread cpu
3 participants