parisc: Handle kprobes breakpoints only in kernel context
authorHelge Deller <deller@gmx.de>
Wed, 24 May 2023 12:31:14 +0000 (14:31 +0200)
committerHelge Deller <deller@gmx.de>
Wed, 24 May 2023 13:46:12 +0000 (15:46 +0200)
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>
arch/parisc/kernel/traps.c

index 13df616..4d5f7b1 100644 (file)
@@ -295,11 +295,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;
        }