Skip to content

Make export::acquire() and export::release() unsafe#659

Merged
bors[bot] merged 3 commits intoknurling-rs:mainfrom
jannic:unsafe-acquire-release
Feb 15, 2022
Merged

Make export::acquire() and export::release() unsafe#659
bors[bot] merged 3 commits intoknurling-rs:mainfrom
jannic:unsafe-acquire-release

Conversation

@jannic
Copy link
Copy Markdown
Contributor

@jannic jannic commented Feb 10, 2022

Calling export::release() may enable interrupts, which is unsound
if done inside a critical section or other code which expects interrupts
to be disabled.

Calling export::acquire() is less dangerous (no obvious way to cause
unsoundness), but is still a bad idea and breaks the safety contract
of critical_section::acquire(), which must only be called paired with
critical_section::release().

Calling export::release() may enable interrupts, which is unsound
if done inside a critical section or other code which expects interrupts
to be disabled.

Calling export::acquire() is less dangerous (no obvious way to cause
unsoundness), but is still a bad idea and breaks the safety contract
of critical_section::acquire(), which must only be called paired with
critical_section::release().
@jannic jannic marked this pull request as ready for review February 10, 2022 23:06
@Urhengulas
Copy link
Copy Markdown
Member

Thank you!

bors r+

@bors
Copy link
Copy Markdown
Contributor

bors Bot commented Feb 15, 2022

Build succeeded:

@bors bors Bot merged commit 6f89322 into knurling-rs:main Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants