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.

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
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().