parisc: Handle Kprobes and KGDB breakpoints only in kernel
Helge Deller
maintainerPATCH 1/1 parisc: Handle Kprobes and KGDB breakpoints only in kernel
context
Reply-To:
The kernel kprobes and kgdb break instructions should only be handled when running in kernel context.
Signed-off-by Helge Deller <[email protected]>
arch/parisc/kernel/traps.c +4 -4
@@ -291,19 +291,19 @@ 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 ; }#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 ; }