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 UB in MutexGuardArc::source #50

Merged
merged 1 commit into from
Jul 7, 2023

Conversation

Jules-Bertholet
Copy link
Collaborator

@Jules-Bertholet Jules-Bertholet commented Jun 15, 2023

MutexGuardArc implements Sync regardless of whether T is Send, but source() allows dropping T from a different thead than it was created in.

This is a breaking change, but a necessary soundness fix.

The alternative would be to change the Sync impl for MutexGuardArc to require T: Send + Sync.

The alternative would be to change the `Sync` impl for  `MutexGuardArc`
to require `T: Send + Sync`.
Copy link
Collaborator

@taiki-e taiki-e left a comment

Choose a reason for hiding this comment

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

Thanks!

@taiki-e taiki-e merged commit 0b7252c into smol-rs:master Jul 7, 2023
@Jules-Bertholet Jules-Bertholet deleted the mutexguardarc-source-send branch July 7, 2023 16:23
@notgull notgull mentioned this pull request Aug 10, 2023
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.

2 participants