From: Helge Deller Date: Wed, 24 May 2023 12:31:14 +0000 (+0200) Subject: parisc: Handle kprobes breakpoints only in kernel context X-Git-Tag: baikal/aarch64/sdk6.2~84 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=d050d3c11b24a4668a4430a7b616917410f8d932;p=kernel.git 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: # v5.18+ Signed-off-by: Helge Deller Signed-off-by: Greg Kroah-Hartman --- diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c index dff447f700421..67b51841dc8b4 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; }