From: Greg Kroah-Hartman Date: Sat, 23 Feb 2019 10:41:47 +0000 (+0100) Subject: 4.19-stable patches X-Git-Tag: v4.9.161~49 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ae4853196e071119b533f139fe2748dfa71d72bf;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: arm-8834-1-fix-kprobes-optimized-kprobes-illegal-instruction.patch --- diff --git a/queue-4.19/arm-8834-1-fix-kprobes-optimized-kprobes-illegal-instruction.patch b/queue-4.19/arm-8834-1-fix-kprobes-optimized-kprobes-illegal-instruction.patch new file mode 100644 index 00000000000..22dd6c58142 --- /dev/null +++ b/queue-4.19/arm-8834-1-fix-kprobes-optimized-kprobes-illegal-instruction.patch @@ -0,0 +1,53 @@ +From 0ac569bf6a7983c0c5747d6df8db9dc05bc92b6c Mon Sep 17 00:00:00 2001 +From: Mathieu Desnoyers +Date: Tue, 5 Feb 2019 16:37:40 +0100 +Subject: ARM: 8834/1: Fix: kprobes: optimized kprobes illegal instruction + +From: Mathieu Desnoyers + +commit 0ac569bf6a7983c0c5747d6df8db9dc05bc92b6c upstream. + +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/342740659.2887.1549307721609.JavaMail.zimbra@efficios.com + +Fixes: e46daee53bb5 ("ARM: 8806/1: kprobes: Fix false positive with FORTIFY_SOURCE") +Signed-off-by: Mathieu Desnoyers +Reported-by: Robert Berger +Tested-by: Robert Berger +Acked-by: Kees Cook +Cc: Robert Berger +Cc: Masami Hiramatsu +Cc: William Cohen +Cc: Laura Abbott +Cc: Kees Cook +Cc: # v4.14+ +Cc: linux-arm-kernel@lists.infradead.org +Cc: patches@armlinux.org.uk +Signed-off-by: Russell King +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/probes/kprobes/opt-arm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- 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 + } + + /* 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. */