Date: Thu, 20 Apr 2017 15:53:20 +0000 (UTC) From: Andrew Turner <andrew@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317197 - head/sys/arm64/arm64 Message-ID: <201704201553.v3KFrKaZ068495@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: andrew Date: Thu Apr 20 15:53:20 2017 New Revision: 317197 URL: https://svnweb.freebsd.org/changeset/base/317197 Log: 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. MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/trap.c Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Thu Apr 20 15:18:15 2017 (r317196) +++ head/sys/arm64/arm64/trap.c Thu Apr 20 15:53:20 2017 (r317197) @@ -135,8 +135,13 @@ svc_handler(struct thread *td, struct tr 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201704201553.v3KFrKaZ068495>