Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F160815048
D25996.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D25996.diff
View Options
Index: head/sys/riscv/riscv/stack_machdep.c
===================================================================
--- head/sys/riscv/riscv/stack_machdep.c
+++ head/sys/riscv/riscv/stack_machdep.c
@@ -47,15 +47,18 @@
#include <machine/stack.h>
static void
-stack_capture(struct stack *st, struct unwind_state *frame)
+stack_capture(struct thread *td, struct stack *st, struct unwind_state *frame)
{
stack_zero(st);
while (1) {
+ if ((vm_offset_t)frame->fp < td->td_kstack ||
+ (vm_offset_t)frame->fp >= td->td_kstack +
+ td->td_kstack_pages * PAGE_SIZE)
+ break;
unwind_frame(frame);
- if (!INKERNEL((vm_offset_t)frame->fp) ||
- !INKERNEL((vm_offset_t)frame->pc))
+ if (!INKERNEL((vm_offset_t)frame->pc))
break;
if (stack_put(st, frame->pc) == -1)
break;
@@ -78,7 +81,7 @@
frame.fp = td->td_pcb->pcb_s[0];
frame.pc = td->td_pcb->pcb_ra;
- stack_capture(st, &frame);
+ stack_capture(td, st, &frame);
return (0);
}
@@ -94,5 +97,5 @@
frame.fp = (uintptr_t)__builtin_frame_address(0);
frame.pc = (uintptr_t)stack_save;
- stack_capture(st, &frame);
+ stack_capture(curthread, st, &frame);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jun 29, 4:15 AM (9 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34452546
Default Alt Text
D25996.diff (1 KB)
Attached To
Mode
D25996: Check that the frame pointer is within the current stack.
Attached
Detach File
Event Timeline
Log In to Comment