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] [day] [month] [year] [list]
Date:   Fri, 17 Jul 2020 16:29:55 +0000
From:   Nick Terrell <terrelln@...com>
To:     Arvind Sankar <nivedita@...m.mit.edu>
CC:     Nick Terrell <nickrterrell@...il.com>,
        Borislav Petkov <bp@...en8.de>,
        Thomas Gleixner <tglx@...utronix.de>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        Chris Mason <clm@...com>,
        "linux-kbuild@...r.kernel.org" <linux-kbuild@...r.kernel.org>,
        "x86@...nel.org" <x86@...nel.org>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        Petr Malat <oss@...at.biz>, Kees Cook <keescook@...omium.org>,
        Kernel Team <Kernel-team@...com>,
        Adam Borowski <kilobyte@...band.pl>,
        Patrick Williams <patrickw3@...com>,
        "Michael van der Westhuizen" <rmikey@...com>,
        "mingo@...nel.org" <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>,
        "Alex Xu" <alex_y_xu@...oo.ca>
Subject: Re: [PATCH v7 2/7] lib: add zstd support to decompress



> On Jul 14, 2020, at 5:42 PM, Arvind Sankar <nivedita@...m.mit.edu> wrote:
> 
> On Wed, Jul 08, 2020 at 11:50:19AM -0700, Nick Terrell wrote:
>> From: Nick Terrell <terrelln@...com>
>> 
>> * Add unzstd() and the zstd decompress interface.
>> * Add zstd support to decompress_method().
>> 
>> The decompress_method() and unzstd() functions are used to decompress
>> the initramfs and the initrd. The __decompress() function is used in
>> the preboot environment to decompress a zstd compressed kernel.
>> 
>> The zstd decompression function allows the input and output buffers to
>> overlap because that is used by x86 kernel decompression.
>> 
>> Reviewed-by: Kees Cook <keescook@...omium.org>
>> Tested-by: Sedat Dilek <sedat.dilek@...il.com>
>> Signed-off-by: Nick Terrell <terrelln@...com>
>> + *
>> + * __DISABLE_EXPORTS stops zstd and xxhash from declaring themselves
>> + * as modules by disabling the EXPORT_SYMBOL macro.
>> + */
> 
> Hi Nick, this doesn't actually work, because misc.c includes export.h
> via
> 	"misc.h" -> <linux/linkage.h> -> <linux/export.h>
> and EXPORT_SYMBOL is already defined before __DISABLE_EXPORTS is defined
> here.
> 
> Adding -D__EXPORT_SYMBOLS to KBUILD_CFLAGS in arch/x86/boot/compressed/Makefile
> fixes that, and then you don't have to define it here.
> 
> Also, __DISABLE_EXPORTS does not currently inhibit MODULE_INFO, so a
> .modinfo section gets emitted into misc.o. I *think* this is harmless
> and it will get discarded when building compressed/vmlinux, but thought
> I'd point it out.

Thanks for pointing that out! I’m surprised that the zstd compressed kernels built and ran
successfully, I vaguely remember that failing in the past. I will put up a fix shortly.

-Nick

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ