diff --git a/sys/riscv/riscv/db_trace.c b/sys/riscv/riscv/db_trace.c --- a/sys/riscv/riscv/db_trace.c +++ b/sys/riscv/riscv/db_trace.c @@ -84,7 +84,8 @@ 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;