-
Notifications
You must be signed in to change notification settings - Fork 654
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
cmsg_space still seems to be unsound #1142
Comments
MikailBag
changed the title
cmsg_space seems to still be unsound
cmsg_space still seems to be unsound
Oct 22, 2019
Yep, the rules on uninitialized memory keep getting stricter. The best way to solve this particular problem would probably be to:
However, there are other functions that need to be changed to, to work in the world of |
kevinwern
pushed a commit
to kevinwern/nix
that referenced
this issue
Dec 2, 2019
This eliminates one of the last remaining uninitialized memory accesses in Nix. Fixes nix-rust#1142
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm confused by this line: https://docs.rs/nix/0.15.0/src/nix/sys/socket/mod.rs.html#316
You create Vec of u8's, and then set_len to capacity.
This code works on stable, but nightly Miri rejects it: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=d86164c2556514deed58418394277481
Note that macro returns vector, so user can e.g. dbg! it, or observe it contents in any other way.
AFAIK, whether primitive types can have uninitialized bits is topic of active discussion, and such usage probably should be avoided
The text was updated successfully, but these errors were encountered: