diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2024-02-21 15:53:08 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2024-02-21 15:53:08 +0000 |
commit | b021028e3665c779d99e3d440c60183555b1d42c (patch) | |
tree | 981a7726b0b75a20be4ca9f9c00cf08419b83cde /sys | |
parent | 80961ddc7c0bfc6fe085c3c91f4b54a06bcb7169 (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')
-rw-r--r-- | sys/arch/amd64/amd64/trap.c | 4 | ||||
-rw-r--r-- | sys/arch/arm64/arm64/trap.c | 4 | ||||
-rw-r--r-- | sys/sys/siginfo.h | 5 |
3 files changed, 7 insertions, 6 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(); diff --git a/sys/sys/siginfo.h b/sys/sys/siginfo.h index c534ab10474..d071f4fe5ea 100644 --- a/sys/sys/siginfo.h +++ b/sys/sys/siginfo.h @@ -1,4 +1,4 @@ -/* $OpenBSD: siginfo.h,v 1.13 2022/10/25 16:08:26 kettenis Exp $ */ +/* $OpenBSD: siginfo.h,v 1.14 2024/02/21 15:53:07 deraadt Exp $ */ /* * Copyright (c) 1997 Theo de Raadt @@ -61,7 +61,8 @@ union sigval { #define ILL_PRVREG 6 /* privileged register */ #define ILL_COPROC 7 /* co-processor */ #define ILL_BADSTK 8 /* bad stack */ -#define NSIGILL 8 +#define ILL_BTCFI 9 /* IBT missing on indirect call */ +#define NSIGILL 9 #define EMT_TAGOVF 1 /* tag overflow */ #define NSIGEMT 1 |