diff options
| author | Todd Poynor <toddpoynor@google.com> | 2013-07-03 15:48:04 -0700 |
|---|---|---|
| committer | Colin Cross <ccross@android.com> | 2013-09-19 13:50:04 -0500 |
| commit | c4715194082e79c7fb8e82e0f373f27a01ed3676 (patch) | |
| tree | 986aa42912c93c56cc6c086ed349047c4317f4bc | |
| parent | a88f9e27498afaea615ad3e93af4f26df1f84987 (diff) | |
| download | olio-linux-3.10-c4715194082e79c7fb8e82e0f373f27a01ed3676.tar.xz olio-linux-3.10-c4715194082e79c7fb8e82e0f373f27a01ed3676.zip | |
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>
| -rw-r--r-- | arch/arm/kernel/kgdb.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm/kernel/kgdb.c b/arch/arm/kernel/kgdb.c index 778c2f7024f..b321c8fbb87 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); |