diff options
author | John Baldwin <jhb@FreeBSD.org> | 2020-04-21 17:38:07 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2020-04-21 17:38:07 +0000 |
commit | 5c4309b4749d3984eb64e8d2f16408e5cee9ff4b (patch) | |
tree | b33afb78dc75eb671c79982377f2c3d71dbc2b9f /sys/cddl/dev | |
parent | 0c0119856bcaa27c3d2aa5c0c4a1dd614e0a0eac (diff) | |
download | src-5c4309b4749d3984eb64e8d2f16408e5cee9ff4b.tar.gz src-5c4309b4749d3984eb64e8d2f16408e5cee9ff4b.zip |
Handle non-dtrace-triggered kernel breakpoint traps in mips.
If DTRACE is enabled at compile time, all kernel breakpoint traps are
first given to dtrace to see if they are triggered by a FBT probe.
Previously if dtrace didn't recognize the trap, it was silently
ignored breaking the handling of other kernel breakpoint traps such as
the debug.kdb.enter sysctl. This only returns early from the trap
handler if dtrace recognizes the trap and handles it.
Submitted by: Nicolò Mazzucato <nicomazz97@gmail.com>
Reviewed by: markj
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D24478
Notes
Notes:
svn path=/head/; revision=360168
Diffstat (limited to 'sys/cddl/dev')
-rw-r--r-- | sys/cddl/dev/dtrace/mips/dtrace_subr.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/cddl/dev/dtrace/mips/dtrace_subr.c b/sys/cddl/dev/dtrace/mips/dtrace_subr.c index 56ae129370fd..c5ebe778b82d 100644 --- a/sys/cddl/dev/dtrace/mips/dtrace_subr.c +++ b/sys/cddl/dev/dtrace/mips/dtrace_subr.c @@ -251,6 +251,9 @@ dtrace_invop_start(struct trapframe *frame) int invop; invop = dtrace_invop(frame->pc, frame, frame->pc); + if (invop == 0) + return (-1); + offs = (invop & LDSD_DATA_MASK); sp = (register_t *)((uint8_t *)frame->sp + offs); |