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

Rework UnixAddr to fix soundness issues #1496

Merged
merged 1 commit into from
Sep 19, 2021

Conversation

coolreader18
Copy link
Contributor

Fixes #1494

I went with making sun_path always nul-terminated since that just seems to make things easier, since (at least according to linux man pages) sockaddr_uns returned by the kernel will always be nul-terminated.

src/sys/socket/addr.rs Outdated Show resolved Hide resolved
src/sys/socket/addr.rs Outdated Show resolved Hide resolved
src/sys/socket/addr.rs Outdated Show resolved Hide resolved
src/sys/socket/addr.rs Outdated Show resolved Hide resolved
@coolreader18 coolreader18 force-pushed the encapsulate-unixaddr branch 2 times, most recently from 644e725 to 28515b0 Compare August 22, 2021 22:28
@coolreader18
Copy link
Contributor Author

I also just changed the documentation of sockaddr_storage_to_addr.

@coolreader18
Copy link
Contributor Author

@asomers could you take a look?

Copy link
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

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

Changing the meaning of len in sockaddr_storage_to_addr is a big deal. Can you make that backwards compatible instead?

src/sys/socket/addr.rs Outdated Show resolved Hide resolved
src/sys/socket/mod.rs Outdated Show resolved Hide resolved
Copy link
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

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

bors r+

@bors bors bot merged commit 4f58c8c into nix-rust:master Sep 19, 2021
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.

Unsoundness in UnixPath
2 participants