Skip to content
Commit d3023897 authored by Michael Karcher's avatar Michael Karcher Committed by Yoshinori Sato
Browse files

arch/sh: Check for kprobe trap number before trying to handle a kprobe trap



The DIE_TRAP notifier chain is run both for kprobe traps and for BUG/WARN
traps. The kprobe code assumes to be only called for
BREAKPOINT_INSTRUCTION, and concludes to have hit a concurrently removed
kprobe if it finds anything else at the faulting locations. This includes
TRAPA_BUG_OPCODE used for BUG and WARN.

The consequence is that kprobe_handler returns 1. This makes
kprobe_exceptions_notify return NOTIFY_STOP, and prevents handling the BUG
statement. This also prevents moving $pc away from the trap instruction,
so the system locks up in an endless loop

Signed-off-by: default avatarMichael Karcher <kernel@mkarcher.dialup.fu-berlin.de>
Signed-off-by: default avatarYoshinori Sato <ysato@users.sourceforge.jp>
parent 7c04efc8
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment