Skip to content

Properly initialize msghdr when using musl#1136

Merged
bors[bot] merged 1 commit intonix-rust:masterfrom
yshui:master
Oct 15, 2019
Merged

Properly initialize msghdr when using musl#1136
bors[bot] merged 1 commit intonix-rust:masterfrom
yshui:master

Conversation

@yshui
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

yshui commented Oct 15, 2019

@posborne Done!

Copy link
Copy Markdown
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 <yshuiv7@gmail.com>
@bors
Copy link
Copy Markdown
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