Uh oh!
There was an error while loading. Please reload this page.
[release/6.0] Use "read" to fetch misaligned 64bit values from bundle header - #63519
Conversation
ghost
commented
Jan 7, 2022
Tagging subscribers to this area: @agocke, @vitek-karas, @VSadov |
danmoseley
commented
Jan 8, 2022
OpenDevices01 fix is just now ported. |
VSadov
commented
Jan 8, 2022
This change only impacts the |
danmoseley
commented
Jan 8, 2022
Indeed, our comments crossed. I do not know about the ios failures. I can re-run. |
danmoseley
commented
Jan 8, 2022
Should we consider adjusting one of our CI test configurations to set |
VSadov
commented
Jan 8, 2022
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.
Approved. We should take for consideration in 6.0.x
danmoseley
commented
Jan 11, 2022
I'll let you open the issue if you think it's worthwhile, as you have more context. |
agocke
commented
Jan 11, 2022
Issue created #63638 |
mmitche
commented
Jan 13, 2022
@jeffschwMSFT This missed the check-in window. Is it critical for 6.0.2? |
agocke
commented
Jan 13, 2022
We only have customer who reported this — probably fine to get it in the next patch |
jeffschwMSFT
commented
Jan 13, 2022
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.