public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation•org>
To: linux-kernel@vger•kernel.org
Cc: Kees Cook <keescook@chromium•org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation•org>,
	stable@vger•kernel.org, Russell King <rmk+kernel@armlinux•org.uk>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios•com>,
	Masami Hiramatsu <mhiramat@kernel•org>,
	Robert Berger <Robert.Berger@ReliableEmbeddedSystems•com>,
	William Cohen <wcohen@redhat•com>,
	Laura Abbott <labbott@redhat•com>,
	linux-arm-kernel@lists•infradead.org, patches@armlinux•org.uk
Subject: [PATCH 4.20 001/183] ARM: 8834/1: Fix: kprobes: optimized kprobes illegal instruction
Date: Mon, 25 Feb 2019 22:09:34 +0100	[thread overview]
Message-ID: <20190225195054.951789086@linuxfoundation.org> (raw)
In-Reply-To: <20190225195054.748060397@linuxfoundation.org>

4.20-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Mathieu Desnoyers <mathieu.desnoyers@efficios•com>

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 <mathieu.desnoyers@efficios•com>
Reported-by: Robert Berger <Robert.Berger@ReliableEmbeddedSystems•com>
Tested-by: Robert Berger <Robert.Berger@ReliableEmbeddedSystems•com>
Acked-by: Kees Cook <keescook@chromium•org>
Cc: Robert Berger <Robert.Berger@ReliableEmbeddedSystems•com>
Cc: Masami Hiramatsu <mhiramat@kernel•org>
Cc: William Cohen <wcohen@redhat•com>
Cc: Laura Abbott <labbott@redhat•com>
Cc: Kees Cook <keescook@chromium•org>
Cc: <stable@vger•kernel.org> # v4.14+
Cc: linux-arm-kernel@lists•infradead.org
Cc: patches@armlinux•org.uk
Signed-off-by: Russell King <rmk+kernel@armlinux•org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation•org>

---
 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. */



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists•infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

           reply	other threads:[~2019-02-25 21:28 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20190225195054.748060397@linuxfoundation.org>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190225195054.951789086@linuxfoundation.org \
    --to=gregkh@linuxfoundation$(echo .)org \
    --cc=Robert.Berger@ReliableEmbeddedSystems$(echo .)com \
    --cc=keescook@chromium$(echo .)org \
    --cc=labbott@redhat$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=mathieu.desnoyers@efficios$(echo .)com \
    --cc=mhiramat@kernel$(echo .)org \
    --cc=patches@armlinux$(echo .)org.uk \
    --cc=rmk+kernel@armlinux$(echo .)org.uk \
    --cc=stable@vger$(echo .)kernel.org \
    --cc=wcohen@redhat$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox