summaryrefslogtreecommitdiff
path: root/arch/arm64/kernel
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2016-07-19 17:07:39 +0300
committerCatalin Marinas <catalin.marinas@arm.com>2016-07-19 19:00:29 +0300
commit44bd887ce10eb8061f6a137f8a73f823957edd82 (patch)
tree01c45387b5a4e9b7ec7a0328299d569fe8e05da5 /arch/arm64/kernel
parentaf78cede8bfc772baf424fc03f7cd3c8f9437733 (diff)
downloadlinux-44bd887ce10eb8061f6a137f8a73f823957edd82.tar.xz
arm64: kprobes: WARN if attempting to step with PSTATE.D=1
Stepping with PSTATE.D=1 is bad news. The step won't generate a debug exception and we'll likely walk off into random data structures. This should never happen, but when it does, it's a PITA to debug. Add a WARN_ON to shout if we realise this is about to take place. Signed-off-by: Will Deacon <will.deacon@arm.com> Acked-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/kernel')
-rw-r--r--arch/arm64/kernel/probes/kprobes.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c
index 9c70e8812ea9..c89811d1e294 100644
--- a/arch/arm64/kernel/probes/kprobes.c
+++ b/arch/arm64/kernel/probes/kprobes.c
@@ -254,6 +254,8 @@ static void __kprobes setup_singlestep(struct kprobe *p,
if (kcb->kprobe_status == KPROBE_REENTER)
spsr_set_debug_flag(regs, 0);
+ else
+ WARN_ON(regs->pstate & PSR_D_BIT);
/* IRQs and single stepping do not mix well. */
kprobes_save_local_irqflag(kcb, regs);