mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-21 18:50:50 +01:00
riscv db_trace: Ensure trapframe pointer is suitably aligned.
Suggested by: jrtc27 Reviewed by: jrtc27 Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D41534
This commit is contained in:
parent
682d5a87e5
commit
7ccaf76a27
@ -84,7 +84,8 @@ db_stack_trace_cmd(struct thread *td, struct unwind_state *frame)
|
||||
struct trapframe *tf;
|
||||
|
||||
tf = (struct trapframe *)(uintptr_t)frame->sp;
|
||||
if (!kstack_contains(td, (vm_offset_t)tf,
|
||||
if (!__is_aligned(tf, _Alignof(*tf)) ||
|
||||
!kstack_contains(td, (vm_offset_t)tf,
|
||||
sizeof(*tf))) {
|
||||
db_printf("--- invalid trapframe %p\n", tf);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user