summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2023-05-24 14:34:58 +0200
committerHelge Deller <deller@gmx.de>2023-05-24 15:46:12 +0200
commit6888ff04e37d01295620a73f3f7efbc79f6ef152 (patch)
treef05b8e90b3b040abfc8a0ce024a1f6b5e5a2f2fa /arch
parentdf419492e428b6a2bce98d0f613c58a13da6666c (diff)
parisc: Handle kgdb breakpoints only in kernel context
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>
Diffstat (limited to 'arch')
-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 4d5f7b167a65..304eebd1c83e 100644
--- a/arch/parisc/kernel/traps.c
+++ b/arch/parisc/kernel/traps.c
@@ -306,8 +306,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;
}