git: f323ecb4e075 - stable/13 - arm64: Raise a SIGBUS on a user external abort
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 19 Feb 2024 16:44:52 UTC
The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=f323ecb4e075f48f23d94f91b2b4b99074c21ebf commit f323ecb4e075f48f23d94f91b2b4b99074c21ebf Author: Andrew Turner <andrew@FreeBSD.org> AuthorDate: 2023-09-29 13:55:48 +0000 Commit: Andrew Turner <andrew@FreeBSD.org> CommitDate: 2024-02-19 12:40:25 +0000 arm64: Raise a SIGBUS on a user external abort When userspace triggers an external abort allow it to handle the abort by raising a SIGBUS. Reviewed by: markj, kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42018 (cherry picked from commit a69450102ff1fe1466077a021a16bb265274d3a2) --- sys/arm64/arm64/trap.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c index d6f847d6b88c..74122cd508ab 100644 --- a/sys/arm64/arm64/trap.c +++ b/sys/arm64/arm64/trap.c @@ -223,19 +223,25 @@ static void external_abort(struct thread *td, struct trapframe *frame, uint64_t esr, uint64_t far, int lower) { + if (lower) { + call_trapsignal(td, SIGBUS, BUS_OBJERR, (void *)far, + ESR_ELx_EXCEPTION(frame->tf_esr)); + userret(td, frame); + return; + } /* * Try to handle synchronous external aborts caused by * bus_space_peek() and/or bus_space_poke() functions. */ - if (!lower && test_bs_fault((void *)frame->tf_elr)) { + if (test_bs_fault((void *)frame->tf_elr)) { frame->tf_elr = (uint64_t)generic_bs_fault; return; } print_registers(frame); print_gp_register("far", far); - panic("Unhandled EL%d external data abort", lower ? 0: 1); + panic("Unhandled external data abort"); } static void