From: Helge Deller Date: Wed, 24 May 2023 12:34:58 +0000 (+0200) Subject: parisc: Handle kgdb breakpoints only in kernel context X-Git-Tag: baikal/aarch64/sdk5.10~33 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=569132e98117e6628f1bd4dcc090fe9ad548f7cf;p=kernel.git parisc: Handle kgdb breakpoints only in kernel context commit 6888ff04e37d01295620a73f3f7efbc79f6ef152 upstream. The kernel kgdb break instructions should only be handled when running in kernel context. Cc: # v5.4+ 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 37988f7f3abcb..10776991296a0 100644 --- a/arch/parisc/kernel/traps.c +++ b/arch/parisc/kernel/traps.c @@ -305,8 +305,8 @@ static void handle_break(struct pt_regs *regs) #endif #ifdef CONFIG_KGDB - if (unlikely(iir == PARISC_KGDB_COMPILED_BREAK_INSN || - iir == PARISC_KGDB_BREAK_INSN)) { + if (unlikely((iir == PARISC_KGDB_COMPILED_BREAK_INSN || + iir == PARISC_KGDB_BREAK_INSN)) && !user_mode(regs)) { kgdb_handle_exception(9, SIGTRAP, 0, regs); return; }