Repository navigation
fix(android): unwind past PAC-signed return addresses - #2263
Merged
Merged
Conversation
Another mapping of an APK library's ELF header can lie anywhere in the address space. `is_duplicated_mapping()` accepted any mapping with the same inode and file offset, so without another module in between, the library merged into the earlier mapping, with a wrong `image_addr` and an `image_size` covering both. Accept such a mapping only within the module's `PT_LOAD` span. Share the program header walk with `get_code_id_from_program_header()` via `ELF_PROGRAM_HEADER_ITER`. Fixes: #2261
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2263 +/- ##
==========================================
+ Coverage 75.53% 75.57% +0.03%
==========================================
Files 103 103
Lines 28315 28315
Branches 5203 5203
==========================================
+ Hits 21389 21400 +11
+ Misses 5578 5570 -8
+ Partials 1348 1345 -3 🚀 New features to boost your workflow:
|
The test mapped the executable's ELF header again twice its file size below it, assuming its load range is smaller. Clang links the TSAN runtime statically, and its `.bss` makes the load range about four times the file size, so the mapping landed inside it, where it still merges by design. Size the gap from the executable's `PT_LOAD` segments instead.
On Armv8.3+ devices, native stack traces ended at the first PAC-signed return address, because libunwindstack-ndk only stripped PAC with a mask that nothing sets. Bump it to strip with `xpaclri` like bionic does. Fixes: #2258
jpnurmi
force-pushed
the
jpnurmi/fix/android-pac
branch
from
October 28, 2026 10:47
b649fde to
21b50df
Compare
mujacica
approved these changes
Oct 28, 2026
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.
Depends on:
On Armv8.3+ devices, native stack traces ended at the first PAC-signed return address, because libunwindstack-ndk only stripped PAC with a mask that nothing sets. Bump it to strip with
xpaclrilike bionic does.Note: We don't have Android ARM64 covered by the CI, so getsentry/libunwindstack-ndk#12 was manually tested. See details in the PR description.
Fixes: #2258