]> git.baikalelectronics.ru Git - kernel.git/commitdiff
parisc: Handle kgdb breakpoints only in kernel context
authorHelge Deller <deller@gmx.de>
Wed, 24 May 2023 12:34:58 +0000 (14:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 May 2023 11:44:09 +0000 (12:44 +0100)
commit 6888ff04e37d01295620a73f3f7efbc79f6ef152 upstream.

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

Cc: <stable@vger.kernel.org> # v5.4+
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/parisc/kernel/traps.c

index 37988f7f3abcb9e316105e16d1693143a777a6bd..10776991296a033bc6b5a7d71c60366184523b80 100644 (file)
@@ -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;
        }