Repository navigation
Conversation
Some MT6833 download agents insert a 16-bit Thumb NOP between the ufshcd_probe_hba return and the following 32-bit HBA literal. Reading the literal at a fixed +8 offset then combines the NOP with half of the address. Resolve the word-aligned literal after the return, consume the alignment NOP when required, and fail closed on truncated or unaligned data. Add focused fixtures for aligned, unpadded and invalid layouts. Reported-by: ogmkp
Jz8Root
force-pushed
the
jz8/ufs-literal-alignment
branch
from
October 28, 2026 12:16
3449b80 to
e891cac
Compare
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.
Summary
Handle the optional 16-bit Thumb alignment NOP between an MT6833
ufshcd_probe_hbareturn sequence and the following UFS HBA literal.Root cause
XFlashExt.patch()currently locates this MT6833 return sequence:and reads the following pointer at
pattern_offset + 8.The DA used by the POCO M4 5G
thunderreport places a NOP before the literal:The fixed
+8read starts on the NOP and produces0x6CD0BF00. The correct,word-aligned literal is
0x40066CD0.Change
00 BFonly when it is required to reach word alignment.a partial address into
da_x.bin.No device pointer or DA-specific absolute address is hardcoded.
Validation
Added focused
unittestfixtures for:Commands run on current upstream
main(118a000a):All checks pass. The reporter's standalone equivalent was validated on hardware;
this PR implements the same correction generically. The generic upstream diff
has not been re-run on that phone.
Evidence and attribution
Reported by @ogmkp in:
Jz8Root/xiaomi-hyperos-bootloader-unlock#18
The report includes the DA2 region coordinates, disassembly, incorrect/correct
pointer values and the successful RPMB operation after the RAM-only correction.
The reporter requested attribution by GitHub handle rather than an email trailer.