lkml.org 
[lkml]   [2020]   [Jul]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v7 2/7] lib: add zstd support to decompress
Date


> On Jul 14, 2020, at 5:42 PM, Arvind Sankar <nivedita@alum.mit.edu> wrote:
>
> On Wed, Jul 08, 2020 at 11:50:19AM -0700, Nick Terrell wrote:
>> From: Nick Terrell <terrelln@fb.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@chromium.org>
>> Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
>> Signed-off-by: Nick Terrell <terrelln@fb.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
\
 
 \ /
  Last update: 2020-07-17 18:33    [W:0.508 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site