diff options
author | avg <avg@FreeBSD.org> | 2016-04-12 06:46:54 +0000 |
---|---|---|
committer | avg <avg@FreeBSD.org> | 2016-04-12 06:46:54 +0000 |
commit | 73eedd1d08c98970f7bd52f860278c3c54125f81 (patch) | |
tree | 5413cb77da797aad0fc528a65f5ec9d1365657a5 | |
parent | 12e88a89ea44278b303ef31f2c934425e613bb9c (diff) | |
download | FreeBSD-src-73eedd1d08c98970f7bd52f860278c3c54125f81.zip FreeBSD-src-73eedd1d08c98970f7bd52f860278c3c54125f81.tar.gz |
[amd64] dtrace_invop handler is to be called only for kernel exceptions
DTrace-related exceptions in userland code are handled elsewhere.
One practical problem was a crash in dtrace_invop_start() when saved
%rsp pointed to a virtual address that was not backed.
i386 code already ignored userland exceptions.
Reviewed by: markj, kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D5906
-rw-r--r-- | sys/amd64/amd64/exception.S | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/amd64/amd64/exception.S b/sys/amd64/amd64/exception.S index a855bd3..caabfd9 100644 --- a/sys/amd64/amd64/exception.S +++ b/sys/amd64/amd64/exception.S @@ -211,6 +211,8 @@ alltraps_pushregs_no_rdi: * interrupt. For all other trap types, just handle them in * the usual way. */ + testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ + jnz calltrap /* ignore userland traps */ cmpl $T_BPTFLT,TF_TRAPNO(%rsp) jne calltrap |