aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDapeng Gao <dapeng@dpgao.cn>2022-11-16 18:29:28 +0000
committerBrooks Davis <brooks@FreeBSD.org>2022-11-16 18:29:28 +0000
commit61b146ba43cd3886c81e79b37fdc665d6e1d74b8 (patch)
tree7b7e8fe4fada7baa60b1db54a0a719a0bc4f997e /sys
parent07853c6c9dd1c7cd5511186992846c4b9ca6d9e7 (diff)
Diffstat (limited to 'sys')
-rw-r--r--sys/arm64/arm64/unwind.c3
-rw-r--r--sys/riscv/riscv/unwind.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/sys/arm64/arm64/unwind.c b/sys/arm64/arm64/unwind.c
index 470b64c00540..32590da5fc46 100644
--- a/sys/arm64/arm64/unwind.c
+++ b/sys/arm64/arm64/unwind.c
@@ -41,7 +41,8 @@ unwind_frame(struct thread *td, struct unwind_state *frame)
fp = frame->fp;
- if (!kstack_contains(td, fp, sizeof(uintptr_t) * 2))
+ if (!__is_aligned(fp, sizeof(fp)) ||
+ !kstack_contains(td, fp, sizeof(fp) * 2))
return (false);
/* FP to previous frame (X29) */
diff --git a/sys/riscv/riscv/unwind.c b/sys/riscv/riscv/unwind.c
index 9efb1fef9451..175e6423a59c 100644
--- a/sys/riscv/riscv/unwind.c
+++ b/sys/riscv/riscv/unwind.c
@@ -47,7 +47,8 @@ unwind_frame(struct thread *td, struct unwind_state *frame)
fp = frame->fp;
- if (!kstack_contains(td, fp - sizeof(fp) * 2, sizeof(fp) * 2))
+ if (!__is_aligned(fp, sizeof(fp)) ||
+ !kstack_contains(td, fp - sizeof(fp) * 2, sizeof(fp) * 2))
return (false);
frame->sp = fp;