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

Fix corrupted sendmmsg() call #1414

Merged
merged 1 commit into from
Apr 8, 2021
Merged

Conversation

eaufavor
Copy link
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
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
Contributor Author

eaufavor commented Apr 5, 2021

Added, thanks.

CHANGELOG.md 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.

Looks good, but please squash your commits.

CHANGELOG.md Outdated Show resolved Hide resolved
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
Contributor Author

eaufavor commented Apr 7, 2021

Squashed with the updated commit message

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 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
Contributor

bors bot commented Apr 8, 2021

Build failed:

@asomers
Copy link
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.

None yet

3 participants