aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Desnoyers <[email protected]>2019-02-05 16:37:40 +0100
committerRussell King <[email protected]>2019-02-12 15:20:58 +0000
commit0ac569bf6a7983c0c5747d6df8db9dc05bc92b6c (patch)
tree6b2a1dd7f4973804d593fbd68b1d6e9a9bba1a58
parent1b5ba350784242eb1f899bcffd95d2c7cff61e84 (diff)
ARM: 8834/1: Fix: kprobes: optimized kprobes illegal instruction
commit e46daee53bb5 ("ARM: 8806/1: kprobes: Fix false positive with FORTIFY_SOURCE") introduced a regression in optimized kprobes. It triggers "invalid instruction" oopses when using kprobes instrumentation through lttng and perf. This commit was introduced in kernel v4.20, and has been backported to stable kernels 4.19 and 4.14. This crash was also reported by Hongzhi Song on the redhat bugzilla where the patch was originally introduced. Link: https://bugzilla.redhat.com/show_bug.cgi?id=1639397 Link: https://bugs.lttng.org/issues/1174 Link: https://lore.kernel.org/lkml/[email protected] Fixes: e46daee53bb5 ("ARM: 8806/1: kprobes: Fix false positive with FORTIFY_SOURCE") Signed-off-by: Mathieu Desnoyers <[email protected]> Reported-by: Robert Berger <[email protected]> Tested-by: Robert Berger <[email protected]> Acked-by: Kees Cook <[email protected]> Cc: Robert Berger <[email protected]> Cc: Masami Hiramatsu <[email protected]> Cc: William Cohen <[email protected]> Cc: Laura Abbott <[email protected]> Cc: Kees Cook <[email protected]> Cc: <[email protected]> # v4.14+ Cc: [email protected] Cc: [email protected] Signed-off-by: Russell King <[email protected]>
-rw-r--r--arch/arm/probes/kprobes/opt-arm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/probes/kprobes/opt-arm.c b/arch/arm/probes/kprobes/opt-arm.c
index 2c118a6ab358..0dc23fc227ed 100644
--- a/arch/arm/probes/kprobes/opt-arm.c
+++ b/arch/arm/probes/kprobes/opt-arm.c
@@ -247,7 +247,7 @@ int arch_prepare_optimized_kprobe(struct optimized_kprobe *op, struct kprobe *or
}
/* Copy arch-dep-instance from template. */
- memcpy(code, (unsigned char *)optprobe_template_entry,
+ memcpy(code, (unsigned long *)&optprobe_template_entry,
TMPL_END_IDX * sizeof(kprobe_opcode_t));
/* Adjust buffer according to instruction. */