Skip to content

Commit

Permalink
parisc: Handle kgdb breakpoints only in kernel context
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Helge Deller committed May 24, 2023
1 parent df41949 commit 6888ff0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/parisc/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 6888ff0

Please sign in to comment.