Check the frame pointer is within the kernel before accessing it.

This commit is contained in:
Andrew Turner 2015-08-24 17:28:19 +00:00
parent 48600901a8
commit 9b9266e8e7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=287113

View File

@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <machine/stack.h>
#include <machine/vmparam.h>
int
unwind_frame(struct unwind_state *frame)
@ -39,7 +40,7 @@ unwind_frame(struct unwind_state *frame)
uint64_t fp;
fp = frame->fp;
if (fp == 0)
if (!INKERNEL(fp))
return (-1);
frame->sp = fp + 0x10;