aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorPratyush Anand <panand@redhat.com>2014-12-25 19:53:51 +0530
committerSteve Capper <steve.capper@linaro.org>2015-01-27 16:46:20 +0000
commit5eb037d9e5c6b1a3256f59c905214825f3ef2520 (patch)
tree024ce682e62b6350c797ecfbf0596d2c75bd024e /arch
parent807ee93f2284c4dcb629e66717710b16b3fabb09 (diff)
downloadlinux-5eb037d9e5c6b1a3256f59c905214825f3ef2520.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>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm64/kernel/debug-monitors.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c
index 2676b865524..98ba5c8c514 100644
--- a/arch/arm64/kernel/debug-monitors.c
+++ b/arch/arm64/kernel/debug-monitors.c
@@ -306,6 +306,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,
@@ -315,12 +318,11 @@ static int brk_handler(unsigned long addr, unsigned int esr,
};
force_sig_info(SIGTRAP, &info, current);
- } else if (call_break_hook(regs, esr) != DBG_HOOK_HANDLED) {
+ return 0;
+ } else {
pr_warning("Unexpected kernel BRK exception at EL1\n");
return -EFAULT;
}
-
- return 0;
}
int aarch32_break_handler(struct pt_regs *regs)