aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPratyush Anand <panand@redhat.com>2014-12-25 19:53:51 +0530
committerSteven Capper <steve.capper@linaro.org>2015-04-07 12:58:39 +0100
commitd820f8ed7f580b852c32ca10971046886974e3ca (patch)
tree2ad7893013b1f134e2abb2f7dd89e9d0695c78e0
parent566a5ddfd55e1f2864ae7d1bc85413f52c087d44 (diff)
downloadlinux-d820f8ed7f580b852c32ca10971046886974e3ca.tar.gz
ARM64: Handle TRAP_BRKPT for user mode as well
uprobe is registered at break_hook with a unique ESR code. So, when a TRAP_BRKPT occurs, call_break_hook checks if it was for uprobe. If not, then send a SIGTRAP to user. Signed-off-by: Pratyush Anand <panand@redhat.com> Signed-off-by: Steve Capper <steve.capper@linaro.org> Conflicts: arch/arm64/kernel/debug-monitors.c Fixup for debug-monitor
-rw-r--r--arch/arm64/kernel/debug-monitors.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c
index 6ffa05d9738..c0b72d5f5d1 100644
--- a/arch/arm64/kernel/debug-monitors.c
+++ b/arch/arm64/kernel/debug-monitors.c
@@ -317,6 +317,9 @@ static int brk_handler(unsigned long addr, unsigned int esr,
{
siginfo_t info;
+ if (call_break_hook(regs, esr) == DBG_HOOK_HANDLED)
+ return 0;
+
if (user_mode(regs)) {
info = (siginfo_t) {
.si_signo = SIGTRAP,
@@ -327,13 +330,15 @@ static int brk_handler(unsigned long addr, unsigned int esr,
force_sig_info(SIGTRAP, &info, current);
}
+
#ifdef CONFIG_KPROBES
else if ((esr & BRK64_ESR_MASK) == BRK64_ESR_KPROBES) {
if (kprobe_breakpoint_handler(regs, esr) != DBG_HOOK_HANDLED)
return -EFAULT;
}
#endif
- else if (call_break_hook(regs, esr) != DBG_HOOK_HANDLED) {
+
+ else {
pr_warning("Unexpected kernel BRK exception at EL1\n");
return -EFAULT;
}