With the 4/4 split on i386, INKERNEL is always true, and so we do no
validation of the first frame pointer. This pointer will be NULL for a
thread that has been created but was never scheduled, so procstat -kka
reliably panics on i386. Fix the problem by reordering some checks in
the unwind loop: ensure that each frame pointer, including the first,
lies within the bounds of the kernel stack.
Details
Details
- Reviewers
kib - Commits
- rS337230: Verify that each frame pointer lies within the thread's kstack.
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
Thanks!
Prior to this change, we could also take a second trap if the traced code used %rbp for a kernel pointer other than a framepointer. E.g., we have some proprietary assembly libraries that (ab)use rbp in this way.
Would it be possible to impose similar stricter requirements on callpc in an inexpensive way? The difficulty is loadable modules, I guess.
Comment Actions
On amd64 we require all kernel and module text to live in the last 2GB of KVA, so we could check that.