Skip to content

fix(unwinder): Guard invalid ARM32 instruction pointers - #1977

Merged
jpnurmi merged 4 commits into
masterfrom
jpnurmi/fix/unwinder-arm32-ip
Aug 13, 2026
Merged

fix(unwinder): Guard invalid ARM32 instruction pointers#1977
jpnurmi merged 4 commits into
masterfrom
jpnurmi/fix/unwinder-arm32-ip

Conversation

@jpnurmi

@jpnurmi jpnurmi commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

On ARM32, unw_step first asks libunwind whether the current frame is a signal frame. The vendored implementation answers that by reading an instruction directly from the cursor's initial IP. Its local address-space validation is enabled only after this probe, so an unmapped IP faults inside the crash handler instead of returning an unwind error.

This surfaced when unrelated stack-layout changes in #1974 made the handler fallback produce 0x10c as its initial IP. No attachment code ran on that path; the changed layout only exposed the unwinder's unchecked read. The resulting SIGSEGV recursively entered the crash handler and prevented the original abort from being captured.

Check /proc/self/maps before calling unw_step. Keep the initial frame, as the existing invalid-stack-pointer path does, but stop the walk before libunwind can dereference an unmapped address. Cover the failure with an ARM32 context whose initial IP is intentionally unmapped.

On ARM32, unw_step first asks libunwind whether the current frame is a
signal frame. The vendored implementation answers that by reading an
instruction directly from the cursor's initial IP. Its local address-space
validation is enabled only after this probe, so an unmapped IP faults inside
the crash handler instead of returning an unwind error.

This surfaced when unrelated stack-layout changes made the handler fallback
produce 0x10c as its initial IP. No attachment code ran on that path; the
changed layout only exposed the unwinder's unchecked read. The resulting
SIGSEGV recursively entered the crash handler and prevented the original
abort from being captured.

Check /proc/self/maps before calling unw_step. Keep the initial frame, as the
existing invalid-stack-pointer path does, but stop the walk before libunwind
can dereference an unmapped address. Cover the failure with an ARM32 context
whose initial IP is intentionally unmapped.
@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.35%. Comparing base (efe5fff) to head (67c492c).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1977      +/-   ##
==========================================
+ Coverage   74.19%   74.35%   +0.16%     
==========================================
  Files         104      104              
  Lines       25634    25638       +4     
  Branches     4626     4627       +1     
==========================================
+ Hits        19018    19062      +44     
+ Misses       5317     5272      -45     
- Partials     1299     1304       +5     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jpnurmi
jpnurmi requested a review from JoshuaMoelans August 13, 2026 07:22
@jpnurmi
jpnurmi merged commit dcf9623 into master Aug 13, 2026
66 checks passed
@jpnurmi
jpnurmi deleted the jpnurmi/fix/unwinder-arm32-ip branch August 13, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants