diff options
author | 2017-07-20 19:57:35 +0000 | |
---|---|---|
committer | 2017-07-20 19:57:35 +0000 | |
commit | fea668cf7166f871c4edc16d8d6bffcd8008b572 (patch) | |
tree | b7a160bd2597d1b80b77d2f0f34c4469584336d6 | |
parent | Move the execution of the {install,upgrade}.site script to the end (diff) | |
download | wireguard-openbsd-fea668cf7166f871c4edc16d8d6bffcd8008b572.tar.xz wireguard-openbsd-fea668cf7166f871c4edc16d8d6bffcd8008b572.zip |
Bring SIBUS/SIGSEGV reporting in line with amd64 and i386.
ok deraadt@, bluhm@
-rw-r--r-- | sys/arch/arm64/arm64/trap.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/sys/arch/arm64/arm64/trap.c b/sys/arch/arm64/arm64/trap.c index cec2e0ba5b0..df83fbc4010 100644 --- a/sys/arch/arm64/arm64/trap.c +++ b/sys/arch/arm64/arm64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.7 2017/04/29 17:10:43 kettenis Exp $ */ +/* $OpenBSD: trap.c,v 1.8 2017/07/20 19:57:35 kettenis Exp $ */ /*- * Copyright (c) 2014 Andrew Turner * All rights reserved. @@ -136,7 +136,7 @@ data_abort(struct trapframe *frame, uint64_t esr, int lower, int exe) vaddr_t va; union sigval sv; uint64_t far; - int error = 0, sig; + int error = 0, sig, code; pcb = curcpu()->ci_curpcb; p = curcpu()->ci_curproc; @@ -191,13 +191,22 @@ data_abort(struct trapframe *frame, uint64_t esr, int lower, int exe) if (error != 0) { if (lower) { - if (error == ENOMEM) + if (error == ENOMEM) { sig = SIGKILL; - else + code = 0; + } else if (error == EIO) { + sig = SIGBUS; + code = BUS_OBJERR; + } else if (error == EACCES) { sig = SIGSEGV; + code = SEGV_ACCERR; + } else { + sig = SIGSEGV; + code = SEGV_MAPERR; + } sv.sival_ptr = (u_int64_t *)far; - trapsignal(p, sig, 0, SEGV_ACCERR, sv); + trapsignal(p, sig, 0, code, sv); } else { if (curcpu()->ci_idepth == 0 && pcb->pcb_onfault != 0) { |