From 8bdcc09641135ba0d7332c4750c17fe39cdbef69 Mon Sep 17 00:00:00 2001 From: Andrew Turner Date: Sun, 4 Oct 2015 21:16:45 +0000 Subject: [PATCH] When trying to execute from a misaligned address raise a SIGBUS with the invalid address alignment code. Obtained from: EuroBSDCon Sponsored by: ABT Systems Ltd --- sys/arm64/arm64/trap.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c index 058490c6732a..a29f91587e90 100644 --- a/sys/arm64/arm64/trap.c +++ b/sys/arm64/arm64/trap.c @@ -377,6 +377,11 @@ do_el0_sync(struct trapframe *frame) case EXCP_UNKNOWN: el0_excp_unknown(frame); break; + case EXCP_PC_ALIGN: + td = curthread; + call_trapsignal(td, SIGBUS, BUS_ADRALN, (void *)frame->tf_elr); + userret(td, frame); + break; case EXCP_BRK: td = curthread; call_trapsignal(td, SIGTRAP, TRAP_BRKPT, (void *)frame->tf_elr);