summaryrefslogtreecommitdiffstats
path: root/sys/arm64
diff options
context:
space:
mode:
authorandrew <andrew@FreeBSD.org>2017-05-30 13:21:43 +0000
committerandrew <andrew@FreeBSD.org>2017-05-30 13:21:43 +0000
commit47a9c98749e1a947c17d80568ab5f5eda143630e (patch)
treeb5d547d0b2067fe95da1106f3817359a73ce9fd7 /sys/arm64
parentc9ac1eb880a7fae7a6e36d7bd563e21d7c41eaad (diff)
downloadFreeBSD-src-47a9c98749e1a947c17d80568ab5f5eda143630e.zip
FreeBSD-src-47a9c98749e1a947c17d80568ab5f5eda143630e.tar.gz
MFC r317197:
Restrict the arm64 supervisor all instructions to only allow a zero immediate value for system calls. We may wish to use other values in the future for other purposes.
Diffstat (limited to 'sys/arm64')
-rw-r--r--sys/arm64/arm64/trap.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c
index 027c562..d7209de1 100644
--- a/sys/arm64/arm64/trap.c
+++ b/sys/arm64/arm64/trap.c
@@ -135,8 +135,13 @@ svc_handler(struct thread *td, struct trapframe *frame)
struct syscall_args sa;
int error;
- error = syscallenter(td, &sa);
- syscallret(td, error, &sa);
+ if ((frame->tf_esr & ESR_ELx_ISS_MASK) == 0) {
+ error = syscallenter(td, &sa);
+ syscallret(td, error, &sa);
+ } else {
+ call_trapsignal(td, SIGILL, ILL_ILLOPN, (void *)frame->tf_elr);
+ userret(td, frame);
+ }
}
static void
OpenPOWER on IntegriCloud