summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2024-02-21 15:53:08 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2024-02-21 15:53:08 +0000
commitb021028e3665c779d99e3d440c60183555b1d42c (patch)
tree981a7726b0b75a20be4ca9f9c00cf08419b83cde /sys/arch
parent80961ddc7c0bfc6fe085c3c91f4b54a06bcb7169 (diff)
create a new code ILL_BTCFI associated with SIGILL for trap faults which
indicate missing indirect branch target instructions (on the two architectures which currently have this). This becomes nicely visible in kdump: 6526 cat PSIG SIGILL SIG_DFL code=ILL_BTCFI addr=0x438fad6a990 trapno=21 ok kettenis sthen miod rsadowski
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/amd64/amd64/trap.c4
-rw-r--r--sys/arch/arm64/arm64/trap.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/arch/amd64/amd64/trap.c b/sys/arch/amd64/amd64/trap.c
index 4df17486b78..a40de920271 100644
--- a/sys/arch/amd64/amd64/trap.c
+++ b/sys/arch/amd64/amd64/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.104 2024/01/31 06:06:28 guenther Exp $ */
+/* $OpenBSD: trap.c,v 1.105 2024/02/21 15:53:07 deraadt Exp $ */
/* $NetBSD: trap.c,v 1.2 2003/05/04 23:51:56 fvdl Exp $ */
/*-
@@ -424,7 +424,7 @@ usertrap(struct trapframe *frame)
break;
case T_CP:
sig = SIGILL;
- code = (frame->tf_err & 0x7fff) < 4 ? ILL_ILLOPC
+ code = (frame->tf_err & 0x7fff) < 4 ? ILL_BTCFI
: ILL_BADSTK;
break;
diff --git a/sys/arch/arm64/arm64/trap.c b/sys/arch/arm64/arm64/trap.c
index bbe6b04c538..c420b747768 100644
--- a/sys/arch/arm64/arm64/trap.c
+++ b/sys/arch/arm64/arm64/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.47 2023/12/26 09:19:15 kettenis Exp $ */
+/* $OpenBSD: trap.c,v 1.48 2024/02/21 15:53:07 deraadt Exp $ */
/*-
* Copyright (c) 2014 Andrew Turner
* All rights reserved.
@@ -286,7 +286,7 @@ do_el0_sync(struct trapframe *frame)
case EXCP_BRANCH_TGT:
curcpu()->ci_flush_bp();
sv.sival_ptr = (void *)frame->tf_elr;
- trapsignal(p, SIGILL, esr, ILL_ILLOPC, sv);
+ trapsignal(p, SIGILL, esr, ILL_BTCFI, sv);
break;
case EXCP_FPAC:
curcpu()->ci_flush_bp();