summary refs log tree commit diff
path: root/arch/parisc
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2023-05-24 14:31:14 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-05-30 14:03:18 +0100
commitb49706d1799ab8edd3530e19625015fb058e46f5 (patch)
tree42dbdb20688b6b8fa9fae4bb7227a5b2ee29d64f /arch/parisc
parent5596e2ef5f1a4c555e23ccb1d518a06bea21cdec (diff)
downloadlinux-b49706d1799ab8edd3530e19625015fb058e46f5.tar.gz
parisc: Handle kprobes breakpoints only in kernel context
commit df419492e428b6a2bce98d0f613c58a13da6666c upstream.

The kernel kprobes break instructions should only be handled when running
in kernel context.

Cc: <stable@vger.kernel.org> # v5.18+
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/parisc')
-rw-r--r--arch/parisc/kernel/traps.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c
index dff447f70042..67b51841dc8b 100644
--- a/arch/parisc/kernel/traps.c
+++ b/arch/parisc/kernel/traps.c
@@ -291,11 +291,11 @@ static void handle_break(struct pt_regs *regs)
 	}
 
 #ifdef CONFIG_KPROBES
-	if (unlikely(iir == PARISC_KPROBES_BREAK_INSN)) {
+	if (unlikely(iir == PARISC_KPROBES_BREAK_INSN && !user_mode(regs))) {
 		parisc_kprobe_break_handler(regs);
 		return;
 	}
-	if (unlikely(iir == PARISC_KPROBES_BREAK_INSN2)) {
+	if (unlikely(iir == PARISC_KPROBES_BREAK_INSN2 && !user_mode(regs))) {
 		parisc_kprobe_ss_handler(regs);
 		return;
 	}