lkml.org 
[lkml]   [2014]   [Dec]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC 7/8] ARM64: Handle TRAP_BRKPT for user mode as well
Date
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>
---
arch/arm64/kernel/debug-monitors.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c
index 2676b8655241..98ba5c8c5141 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)
--
2.1.0


\
 
 \ /
  Last update: 2014-12-31 16:41    [W:0.789 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site