lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 5 Feb 2019 15:04:12 +0000
From:   Kees Cook <keescook@...omium.org>
To:     Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Cc:     Russell King <rmk+kernel@...linux.org.uk>,
        LKML <linux-kernel@...r.kernel.org>,
        Robert Berger <Robert.Berger@...iableembeddedsystems.com>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        William Cohen <wcohen@...hat.com>,
        Laura Abbott <labbott@...hat.com>,
        "# v4 . 14+" <stable@...r.kernel.org>
Subject: Re: [PATCH 1/1] Fix: arm: kprobes: optimized kprobes illegal instruction

On Mon, Feb 4, 2019 at 9:52 PM Mathieu Desnoyers
<mathieu.desnoyers@...icios.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@...omium.org>

Can you send this to the ARM patch tracker, please?

-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@...icios.com>
> Reported-by: Robert Berger <Robert.Berger@...iableEmbeddedSystems.com>
> Tested-by: Robert Berger <Robert.Berger@...iableEmbeddedSystems.com>
> CC: Robert Berger <Robert.Berger@...iableEmbeddedSystems.com>
> CC: Masami Hiramatsu <mhiramat@...nel.org>
> CC: William Cohen <wcohen@...hat.com>
> CC: Laura Abbott <labbott@...hat.com>
> CC: Kees Cook <keescook@...omium.org>
> CC: Russell King <rmk+kernel@...linux.org.uk>
> CC: <stable@...r.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ