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

Don't deref uninit addrs in pack_mhdr_to_receive #1992

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

djkoloski
Copy link
Contributor

This adds a new method to SockaddrLikePriv to get a pointer to some underlying libc::sockaddr from a pointer to some type. This avoids dereferencing uninitialized values during pack_mhdr_to_receive, which is called from MultiHeaders::preallocate and recvmsg.

Because this is a private trait, this is not a semver-breaking change.

Fixes #1990

This adds a new method to `SockaddrLikePriv` to get a pointer to some
underlying `libc::sockaddr` from a pointer to some type. This avoids
dereferencing uninitialized values during `pack_mhdr_to_receive`, which
is called from `MultiHeaders::preallocate` and `recvmsg`.

Because this is a private trait, this is not a semver-breaking change.
@aarond10
Copy link
Contributor

Can we get this rolled into a release?

@djkoloski
Copy link
Contributor Author

This UB was introduced in #1684. Maybe @asomers would be interested in reviewing it?

@aarond10
Copy link
Contributor

Ping! @asomers, could we get this merged in?

@Jan561 Jan561 mentioned this pull request Nov 23, 2023
3 tasks
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.

Multiheader::preallocate causes an uninitialized value to be dereferenced
2 participants