Skip to content

Fix corrupted sendmmsg() call#1414

Merged
bors[bot] merged 1 commit intonix-rust:masterfrom
eaufavor:fix_sendmmsg
Apr 8, 2021
Merged

Fix corrupted sendmmsg() call#1414
bors[bot] merged 1 commit intonix-rust:masterfrom
eaufavor:fix_sendmmsg

Conversation

@eaufavor
Copy link
Copy Markdown
Contributor

@eaufavor eaufavor commented Apr 2, 2021

Before this fix, the buffer that holds cmsgs may move due to the resize()
call. That causes msg_hdr pointing to invalid memory, which ends up
breaking the sendmmsg() call, resulting in EINVAL.

This change fixes it by avoiding re-allocating the buffers.

Copy link
Copy Markdown
Contributor

@asomers-ax asomers-ax left a comment

Choose a reason for hiding this comment

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

Good find! Would you mind adding a CHANGELOG entry?

@eaufavor
Copy link
Copy Markdown
Contributor Author

eaufavor commented Apr 5, 2021

Added, thanks.

Comment thread CHANGELOG.md Outdated
Copy link
Copy Markdown
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.

Looks good, but please squash your commits.

Comment thread CHANGELOG.md Outdated
Before this fix, the buffer that holds cmsgs may move due to the resize()
call. That causes msg_hdr pointing to invalid memory, which ends up
breaking the sendmmsg() call, resulting in EINVAL.

This change fixes it by avoiding re-allocating the buffers.
@eaufavor
Copy link
Copy Markdown
Contributor Author

eaufavor commented Apr 7, 2021

Squashed with the updated commit message

Copy link
Copy Markdown
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 bot added a commit that referenced this pull request Apr 8, 2021
1414: Fix corrupted sendmmsg() call r=asomers a=eaufavor

Before this fix, the buffer that holds cmsgs may move due to the resize()
call. That causes msg_hdr pointing to invalid memory, which ends up
breaking the sendmmsg() call, resulting in EINVAL.

This change fixes it by avoiding re-allocating the buffers.

Co-authored-by: Yuchen Wu <yuchen@cloudflare.com>
@bors
Copy link
Copy Markdown
Contributor

bors bot commented Apr 8, 2021

Build failed:

@asomers
Copy link
Copy Markdown
Member

asomers commented Apr 8, 2021

bors retry

@bors bors bot merged commit 2cef18b into nix-rust:master Apr 8, 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.

3 participants