Use the kernel stack in the ARM FBT DTrace provider. This is used to find

the fifth argument to functions being traced, however there was an error
where the userspace stack was being used. This may be invalid leading to
a kernel panic if this address is unmapped.

Submitted by:	Graeme Jenkinson <graeme.jenkinson@cl.cam.ac.uk>
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D9229
This commit is contained in:
Andrew Turner 2017-01-18 13:27:24 +00:00
parent 9c1cd3f5c3
commit ae69172343
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=312378

View File

@ -61,7 +61,7 @@ fbt_invop(uintptr_t addr, struct trapframe *frame, uintptr_t rval)
/* Get 5th parameter from stack */
DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);
fifthparam = *(register_t *)frame->tf_usr_sp;
fifthparam = *(register_t *)frame->tf_svc_sp;
DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT | CPU_DTRACE_BADADDR);
dtrace_probe(fbt->fbtp_id, frame->tf_r0,