-
Notifications
You must be signed in to change notification settings - Fork 1.2k
vfork can cause memory corruption due to the lack of #[ffi_returns_twice] #1596
Copy link
Copy link
Closed
Labels
C-bugCategory: bugCategory: bugI-unsound 💥A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessA soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessO-linux
Description
Due to the lack of a stable #[ffi_returns_twice] attribute, vfork cannot be safely used since it can cause memory corruption of unrelated local variables in the parent process.
Miscompilation example: https://play.rust-lang.org/?version=nightly&mode=release&edition=2018&gist=e192ab81e8d408fa9984f766e2356697
Fixed (but nightly-only) version with #[ffi_returns_twice]: https://play.rust-lang.org/?version=nightly&mode=release&edition=2018&gist=0de019e56b69aa048f3e0f5319cc187e
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-bugCategory: bugCategory: bugI-unsound 💥A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessA soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessO-linux
Type
Fields
Give feedbackNo fields configured for issues without a type.