diff options
author | andrew <andrew@FreeBSD.org> | 2017-05-30 13:21:43 +0000 |
---|---|---|
committer | andrew <andrew@FreeBSD.org> | 2017-05-30 13:21:43 +0000 |
commit | 47a9c98749e1a947c17d80568ab5f5eda143630e (patch) | |
tree | b5d547d0b2067fe95da1106f3817359a73ce9fd7 | |
parent | c9ac1eb880a7fae7a6e36d7bd563e21d7c41eaad (diff) | |
download | FreeBSD-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.
-rw-r--r-- | sys/arm64/arm64/trap.c | 9 |
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 |