Ensure proper alignment of cmsg buffers - #234
Merged
Merged
Conversation
The cmsg macros expect a control message buffer to be aligned like a struct cmsghdr. The current layout around those stack-allocated buffers probably provides the required alignment (usually 4 bytes). Use a union to enforce proper alignment, in case future changes modify the stack layout. Spotted when chasing an unrelated bug with Otto Moerbeek (@omoerbeek).
Contributor
|
Thanks. This in need makes sense to do to prevent a potential future issue. There are some |
ralphdolmans
added a commit
that referenced
this pull request
Jul 17, 2020
Courrèges-Anglas. - Fix PR #234 log_assert sizeof to use union buffer.
jedisct1
added a commit
to jedisct1/unbound
that referenced
this pull request
Jul 27, 2020
* nlnet/master: (30 commits) Changelog note for PR NLnetLabs#270 - Merge PR NLnetLabs#270 from cgzones: munin plugin: always exit 0 in autoconf - Merge PR NLnetLabs#269, Fix python module len() implementations, by Torbjörn Lönnemark - branch now named 1.11.1. 1.11.0rc1 became the 1.11.0 release. munin plugin: always exit 0 in autoconf Fix python module len() implementations draft-ietf-dnsop-serve-stale-10 has become RFC 8767 on March 2020 - branch now named 1.11.0 and 1.11.0rc1 tag. - Fix contrib/fastrpz.patch to apply cleanly. It fixes for changes due to added libdynmod, but it does not compile, it conflicts with new rpz code. - Fix contrib/fastrpz.patch to apply cleanly. - Fix contrib/fastrpz.patch to apply cleanly. - Fix streamtcp to print packet data to stdout. This makes the stdout and stderr not mix together lines, when parsing its output. - Fix lock dependency cycle in rpz zone config setup. - Fix libnettle compile for session ticket key callback function changes. - Merge PR NLnetLabs#234 - Ensure proper alignment of cmsg buffers by Jérémie Courrèges-Anglas. - Fix PR NLnetLabs#234 log_assert sizeof to use union buffer. - Fix unused variable warning for clang analyzer. - Fix check conf test for referencing installation paths. - Changelog entry for PR NLnetLabs#265; include-toplevel. Change unbound-dnstap-socket void cast for unused parameter - Add changelog entry for bidirectional frame streams support. correct byte count in comment ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The cmsg macros expect a control message buffer to be aligned like
a struct cmsghdr. The current layout around those stack-allocated
buffers probably provides the required alignment (usually 4 bytes).
Use a union to enforce proper alignment, in case future changes modify
the stack layout.
Spotted when chasing an unrelated bug with Otto Moerbeek (@omoerbeek).