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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YymNzUoGGOKu1e1d@arm.com>
Date:   Tue, 20 Sep 2022 10:54:21 +0100
From:   Catalin Marinas <catalin.marinas@....com>
To:     Ard Biesheuvel <ardb@...nel.org>
Cc:     linux-efi@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org,
        "James E.J. Bottomley" <James.Bottomley@...senpartnership.com>,
        Matthew Garrett <mjg59@...f.ucam.org>,
        Peter Jones <pjones@...hat.com>,
        Ilias Apalodimas <ilias.apalodimas@...aro.org>,
        Heinrich Schuchardt <heinrich.schuchardt@...onical.com>,
        AKASHI Takahiro <takahiro.akashi@...aro.org>,
        Palmer Dabbelt <palmer@...belt.com>,
        Atish Patra <atishp@...shpatra.org>,
        Arnd Bergmann <arnd@...db.de>,
        Huacai Chen <chenhuacai@...ngson.cn>,
        Xi Ruoyao <xry111@...111.site>,
        Lennart Poettering <lennart@...ttering.net>,
        Jeremy Linton <jeremy.linton@....com>,
        Will Deacon <will@...nel.org>
Subject: Re: [PATCH v5 3/8] efi/libstub: use EFI provided memcpy/memset
 routines

On Sat, Sep 10, 2022 at 10:11:47AM +0200, Ard Biesheuvel wrote:
> The stub is used in different execution environments, but on arm64,
> RISC-V and LoongArch, we still use the core kernel's implementation of
> memcpy and memset, as they are just a branch instruction away, and can
> generally be reused even from code such as the EFI stub that runs in a
> completely different address space.
> 
> KAsan complicates this slightly, resulting in the need for some hacks to
> expose the uninstrumented, __ prefixed versions as the normal ones, as
> the latter are instrumented to include the KAsan checks, which only work
> in the core kernel.
> 
> Unfortunately, #define'ing memcpy to __memcpy when building C code does
> not guarantee that no explicit memcpy() calls will be emitted. And with
> the upcoming zboot support, which consists of a separate binary which
> therefore needs its own implementation of memcpy/memset anyway, it's
> better to provide one explicitly instead of linking to the existing one.
> 
> Given that EFI exposes implementations of memmove() and memset() via the
> boot services table, let's wire those up in the appropriate way, and
> drop the references to the core kernel ones.
> 
> Signed-off-by: Ard Biesheuvel <ardb@...nel.org>
> ---
>  arch/arm64/kernel/image-vars.h            | 13 ---------

Acked-by: Catalin Marinas <catalin.marinas@....com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ