[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200708032329.GB1847378@rani.riverdale.lan>
Date: Tue, 7 Jul 2020 23:23:29 -0400
From: Arvind Sankar <nivedita@...m.mit.edu>
To: Kees Cook <keescook@...omium.org>
Cc: Arvind Sankar <nivedita@...m.mit.edu>,
Nick Terrell <nickrterrell@...il.com>,
Borislav Petkov <bp@...en8.de>,
Thomas Gleixner <tglx@...utronix.de>,
linux-kernel@...r.kernel.org, Chris Mason <clm@...com>,
linux-kbuild@...r.kernel.org, x86@...nel.org,
gregkh@...uxfoundation.org, Petr Malat <oss@...at.biz>,
Kernel Team <Kernel-team@...com>,
Adam Borowski <kilobyte@...band.pl>,
Patrick Williams <patrickw3@...com>, rmikey@...com,
mingo@...nel.org, Patrick Williams <patrick@...cx.xyz>,
Sedat Dilek <sedat.dilek@...il.com>,
Norbert Lange <nolange79@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Nick Terrell <terrelln@...com>
Subject: Re: [PATCH v6 2/8] lib: prepare xxhash for preboot environment
On Tue, Jul 07, 2020 at 07:49:25PM -0700, Kees Cook wrote:
> On Tue, Jul 07, 2020 at 05:59:25PM -0400, Arvind Sankar wrote:
> > On Mon, Jul 06, 2020 at 08:45:58PM -0700, Nick Terrell wrote:
> > > From: Nick Terrell <terrelln@...com>
> > >
> > > Don't export symbols if XXH_PREBOOT is defined.
> > >
> > > This change is necessary to get xxhash to work in a preboot environment,
> > > which is needed to support zstd-compressed kernels.
> >
> > The usual way to do it is by adding -D__DISABLE_EXPORTS to the CFLAGS, which will
> > cause EXPORT_SYMBOL to be stubbed out. Doesn't that work here?
>
> This is quite rare, actually:
>
> $ git grep DISABLE_EXPORTS
> arch/s390/purgatory/Makefile:CFLAGS_sha256.o := -D__DISABLE_EXPORTS
> arch/x86/boot/compressed/kaslr.c:#define __DISABLE_EXPORTS
> arch/x86/purgatory/Makefile:CFLAGS_sha256.o := -D__DISABLE_EXPORTS
> drivers/firmware/efi/libstub/Makefile: -D__DISABLE_EXPORTS
> include/linux/export.h:#if !defined(CONFIG_MODULES) || defined(__DISABLE_EXPORTS)
>
> But yes, it seems that would be the better approach.
>
> --
> Kees Cook
Looks like Ard added it a couple of years back [0] but it got used only
for the EFI stub and not the decompressors.
[0] http://lkml.kernel.org/r/20180704083651.24360-3-ard.biesheuvel@linaro.org
Powered by blists - more mailing lists