Page MenuHomeFreeBSD

Perform additional SP sanity check when unwinding stacks on ARMv[67]
Needs ReviewPublic

Authored by rwatson on Oct 4 2015, 10:49 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 20 2023, 1:58 AM
Unknown Object (File)
Nov 15 2023, 4:41 AM
Unknown Object (File)
Aug 28 2023, 11:07 AM
Unknown Object (File)
Aug 26 2023, 2:10 AM
Unknown Object (File)
Jul 8 2023, 6:18 AM
Unknown Object (File)
Jun 26 2023, 11:37 PM
Unknown Object (File)
Jun 21 2023, 9:09 PM
Unknown Object (File)
Jun 16 2023, 3:47 AM
Subscribers

Details

Reviewers
andrew
bz
br
Group Reviewers
ARM
Summary

Catch stack pointers that fall clearly outside of the kernel address space and abort kernel stack unwinding rather than continuing. For failed stack unwinding in the kernel debugger, keeling over just causes the debugger to re-enter. But for production uses of stack unwinding such as PMC and DTrace, a bad pointer dereference is less acceptable behaviour.

Test Plan

Deployed in Cambridge L41 2014-2015.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

rwatson retitled this revision from to Perform additional SP sanity check when unwinding stacks on ARMv[67].
rwatson updated this object.
rwatson edited the test plan for this revision. (Show Details)
rwatson added reviewers: ARM, br, andrew, bz.
rwatson set the repository for this revision to rS FreeBSD src repository - subversion.
sys/arm/arm/unwind.c
228

Why 0xffffff00?

sys/arm/arm/unwind.c
228

Hmm. Good question. I think that aspect of the change originated with you or br, but presumably reflects an actual case that arose. I can remove it, but perhaps br will remember and be able to comment?

mmel added inline comments.
sys/arm/arm/unwind.c
228

You might use a similar approach what is used in https://reviews.freebsd.org/D3617. See read_instruction_nofault().