-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[release/6.0] Use "read" to fetch misaligned 64bit values from bundle header #63519
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
Conversation
|
Tagging subscribers to this area: @agocke, @vitek-karas, @VSadov |
janvorli
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
|
OpenDevices01 fix is just now ported. |
|
This change only impacts the |
|
Indeed, our comments crossed. I do not know about the ios failures. I can re-run. |
|
Should we consider adjusting one of our CI test configurations to set |
Seems like a good idea. It would need to be on linux-arm32, I think. |
jeffschwMSFT
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved. We should take for consideration in 6.0.x
I'll let you open the issue if you think it's worthwhile, as you have more context. |
|
Issue created #63638 |
|
@jeffschwMSFT This missed the check-in window. Is it critical for 6.0.2? |
|
We only have customer who reported this — probably fine to get it in the next patch |
|
I was talking with @safern to coordinate merge. |
Backport of #63431 to release/6.0
Fixes: #62273
Customer Impact
The problem was reported by a customer. Single file does not work on ARM32 devices configured to terminate processes on misaligned memory access (happens on some Raspbian systems, unclear how often they're configured in this way).
Testing
Regular test pass.
Manually tested the app built with singlefilehost that contains the fix on Raspbian (bullseye arm32). The app runs regardless of
/proc/cpu/alignmentsettings.Without the fix, when
/proc/cpu/alignmentis set to 4 (fault), the app crashes on misaligned reads while processing the bundle headers.This is a regression introduced when we added support for compression. With compression, we introduced versioned fields into the header, so the header cannot be memcopied all-at-once and the code was changed to read individual fields from memmapped header, which introduced misaligned reads.
Note that setting
/proc/cpu/alignmentto fault is not typically the default setting. With other settings the kernel can trap the failures and silently handle misaligned reads, so apps run.However, when configured to fail, no singlefile app would run. In such mode it is a regression from 5.0.
Risk
Low. Instead of direct reads of int64 values form mapped header, we call
memcpy, which is alignment-aware.