lkml.org 
[lkml]   [2020]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v7 2/7] lib: add zstd support to decompress
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.

\
 
 \ /
  Last update: 2020-07-14 23:43    [W:1.147 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site