-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
coredump: use unaligned_read_ne{32,64}() to parse auxv #26927
Conversation
342b59f
to
476bd5e
Compare
This comment was marked as off-topic.
This comment was marked as off-topic.
476bd5e
to
8a7f76b
Compare
The change looks good, but the commit message needs to explain what the issue that is being fixes is, and why we didn't see it so far. Edit: In other words: the issue looks significant, but wouldn't be a problem outside of an instrumented run, because the buffer would be aligned in all realistic cases. Or at least that's what I think would be the case. But we should state this explicitly, and include this in the commit message, so we all agree what is happening and what the impact of the issue is. Edit2: actually, the address is unaligned, so maybe it would be an issue outside of an instrumented run too. But on amd64, it's just a slowdown. So a crash would be possible only only other architectures? |
Fixes a bug introduced by 3e4d0f6. The auxv metadata is unaligned, as the length of the prefix "COREDUMP_PROC_AUXV=" is 19. Hence, parse_auxv{32,64}() may triger an undefined behavior (or at least cause slow down), which can be detected when running on an undefined behavior sanitizer. This also introduces a macro to define `parse_auxv{32,64}()`. Fixes systemd#26912.
8a7f76b
to
c9c9961
Compare
@keszybz The commit message is extended. PTAL. |
Perfect! Thanks! |
The CI passed previously, so let's merge this, since the commit message shouldn't influence the result. (I know, with CI one can never be sure, but let's be optimistic ;) ) |
Fixes a bug introduced by 3e4d0f6.
Fixes #26912.