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

Properly initialize msghdr when using musl #1136

Merged
merged 1 commit into from
Oct 15, 2019
Merged

Properly initialize msghdr when using musl #1136

merged 1 commit into from
Oct 15, 2019

Conversation

yshui
Copy link
Contributor

@yshui yshui commented Oct 15, 2019

Because of the use of MaybeUninit::uninit, the padding fields in msghdr,
which only present on musl builds, are not initialized. Causing garbage
data to be sent to the kernel. This change ensures the paddings are
always zeroed.

@posborne
Copy link
Member

Thanks @yshui change LGTM. Can you amend the commit with a changelog addition per https://github.com/nix-rust/nix/blob/master/CONTRIBUTING.md#pull-requests

Because of the use of MaybeUninit::uninit, the padding fields in msghdr,
which only present on musl builds, are not initialized. Causing garbage
data to be sent to the kernel. This change ensures the paddings are
always zeroed.
@yshui
Copy link
Contributor Author

yshui commented Oct 15, 2019

@posborne Done!

Copy link
Member

@posborne posborne 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 bot added a commit that referenced this pull request Oct 15, 2019
1136: Properly initialize msghdr when using musl r=posborne a=yshui

Because of the use of MaybeUninit::uninit, the padding fields in msghdr,
which only present on musl builds, are not initialized. Causing garbage
data to be sent to the kernel. This change ensures the paddings are
always zeroed.

Co-authored-by: Yuxuan Shui <[email protected]>
@bors
Copy link
Contributor

bors bot commented Oct 15, 2019

Build succeeded

@bors bors bot merged commit a510b47 into nix-rust:master Oct 15, 2019
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