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

fix use-after-free in crossbeam-epoch/sync/queue #466

Merged
merged 1 commit into from
Feb 10, 2020

Conversation

tomtomjhj
Copy link
Contributor

pop() must completely unlink the popped node from the shared memory before it calls defer_destroy() to prevent use-after-free. This implementation is based on the variation by Doherty et al. where the head == tail check is done after a successful CAS, which can be slightly more efficient than the original MSQueue.

closes #238

pop() must completely unlink the popped node from the shared memory
before it calls defer_destroy() to prevent use-after-free. This
implementation is based on the variation by Doherty et al. where the
`head == tail` check is done after a successful CAS, which can be
slightly more efficient than the original version.

closes crossbeam-rs#238
@jeehoonkang
Copy link
Contributor

jeehoonkang commented Feb 3, 2020

This patch looks good, but I'm not completely sure whether it closes #238. Is it the case that all queues are fixed?

@tomtomjhj
Copy link
Contributor Author

Other queues use their own reclamation methods.

Copy link
Contributor

@jeehoonkang jeehoonkang left a comment

Choose a reason for hiding this comment

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

LGTM, but I'd like to wait for another +1 (as @tomtomjhj and I are coworking on this patch)

@jeehoonkang
Copy link
Contributor

I'm merging it, as I think it's better to merge bugfix fast...

bors r+

bors bot added a commit that referenced this pull request Feb 10, 2020
466: fix use-after-free in crossbeam-epoch/sync/queue r=jeehoonkang a=tomtomjhj

`pop()` must completely unlink the popped node from the shared memory before it calls `defer_destroy()` to prevent use-after-free. This implementation is based on the variation by Doherty et al. where the `head == tail` check is done after a successful CAS, which can be slightly more efficient than the original MSQueue.

closes #238

Co-authored-by: Jaehwang Jerry Jung <tomtomjhj@gmail.com>
@bors
Copy link
Contributor

bors bot commented Feb 10, 2020

Build succeeded

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

Successfully merging this pull request may close these issues.

Use after free in Michael-Scott queue?
2 participants