From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Kees Cook <keescook@chromium.org>
Cc: Russell King <rmk+kernel@armlinux.org.uk>,
linux-kernel <linux-kernel@vger.kernel.org>,
robert berger <Robert.Berger@reliableembeddedsystems.com>,
Masami Hiramatsu <mhiramat@kernel.org>,
William Cohen <wcohen@redhat.com>,
Laura Abbott <labbott@redhat.com>,
stable <stable@vger.kernel.org>
Subject: Re: [PATCH 1/1] Fix: arm: kprobes: optimized kprobes illegal instruction
Date: Tue, 5 Feb 2019 10:27:49 -0500 (EST) [thread overview]
Message-ID: <894646307.256.1549380469415.JavaMail.zimbra@efficios.com> (raw)
In-Reply-To: <CAGXu5j+iP7FuL8VdQMTHaUPpjxF=rhoFi_2_9w31GmFLZvTPrg@mail.gmail.com>
----- On Feb 5, 2019, at 10:04 AM, Kees Cook keescook@chromium.org wrote:
> On Mon, Feb 4, 2019 at 9:52 PM Mathieu Desnoyers
> <mathieu.desnoyers@efficios.com> wrote:
>>
>> 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.
>
> Ew, yes. Thanks for catching this.
>
> Fixes: e46daee53bb5 ("ARM: 8806/1: kprobes: Fix false positive with
> FORTIFY_SOURCE")
> Acked-by: Kees Cook <keescook@chromium.org>
>
> Can you send this to the ARM patch tracker, please?
Sure, will do right away,
Thanks!
Mathieu
>
> -Kees
>
>>
>> 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
>> 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>
>> 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: Russell King <rmk+kernel@armlinux.org.uk>
>> CC: <stable@vger.kernel.org> # v4.14+
>> ---
>> arch/arm/probes/kprobes/opt-arm.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> 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. */
>> --
>> 2.11.0
>>
>
>
> --
> Kees Cook
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
next prev parent reply other threads:[~2019-02-05 15:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-04 21:52 [PATCH 1/1] Fix: arm: kprobes: optimized kprobes illegal instruction Mathieu Desnoyers
2019-02-05 15:04 ` Kees Cook
2019-02-05 15:27 ` Mathieu Desnoyers [this message]
2019-02-05 15:28 Mathieu Desnoyers
2019-02-05 15:37 Mathieu Desnoyers
2019-02-06 4:39 ` Masami Hiramatsu
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=894646307.256.1549380469415.JavaMail.zimbra@efficios.com \
--to=mathieu.desnoyers@efficios.com \
--cc=Robert.Berger@reliableembeddedsystems.com \
--cc=keescook@chromium.org \
--cc=labbott@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=rmk+kernel@armlinux.org.uk \
--cc=stable@vger.kernel.org \
--cc=wcohen@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).