summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorTodd Poynor <toddpoynor@google.com>2013-07-03 15:48:04 -0700
committerNitin Garg <nitin.garg@freescale.com>2014-04-21 22:35:20 -0500
commitbdb6d63cec80f92d8455b58495dd791fd3981a3a (patch)
treeddc78c5d150e56395e654012f78a548927cbf1b3 /arch
parent0e5754b8493a44a8d3e85e60b25ec4565606d561 (diff)
ARM: kgdb: ignore breakpoint instructions from user mode
Avoid conflicts with user mode usage of the same instructions, as with Clang -ftrapv. Change-Id: I12d1c6d8f94376bfd2503cb0be843d7e478fb6ea Signed-off-by: Todd Poynor <toddpoynor@google.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/kernel/kgdb.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm/kernel/kgdb.c b/arch/arm/kernel/kgdb.c
index 778c2f7024ff..b321c8fbb87d 100644
--- a/arch/arm/kernel/kgdb.c
+++ b/arch/arm/kernel/kgdb.c
@@ -144,6 +144,8 @@ int kgdb_arch_handle_exception(int exception_vector, int signo,
static int kgdb_brk_fn(struct pt_regs *regs, unsigned int instr)
{
+ if (user_mode(regs))
+ return -1;
kgdb_handle_exception(1, SIGTRAP, 0, regs);
return 0;
@@ -151,6 +153,8 @@ static int kgdb_brk_fn(struct pt_regs *regs, unsigned int instr)
static int kgdb_compiled_brk_fn(struct pt_regs *regs, unsigned int instr)
{
+ if (user_mode(regs))
+ return -1;
compiled_break = 1;
kgdb_handle_exception(1, SIGTRAP, 0, regs);