lkml.org 
[lkml]   [2022]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5] module: add in-kernel support for decompressing
On Wed, Jan 05, 2022 at 01:55:12PM -0800, Dmitry Torokhov wrote:
> Current scheme of having userspace decompress kernel modules before
> loading them into the kernel runs afoul of LoadPin security policy, as
> it loses link between the source of kernel module on the disk and binary
> blob that is being loaded into the kernel. To solve this issue let's
> implement decompression in kernel, so that we can pass a file descriptor
> of compressed module file into finit_module() which will keep LoadPin
> happy.
>
> To let userspace know what compression/decompression scheme kernel
> supports it will create /sys/module/compression attribute. kmod can read
> this attribute and decide if it can pass compressed file to
> finit_module(). New MODULE_INIT_COMPRESSED_DATA flag indicates that the
> kernel should attempt to decompress the data read from file descriptor
> prior to trying load the module.
>
> To simplify things kernel will only implement single decompression
> method matching compression method selected when generating modules.
> This patch implements gzip and xz; more can be added later,
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Thanks, I've merged this into the modules-next tree [0]. If 0-day
and the merge wiht linux-next doesn't barf I'll include it as a part of the
upcoming pull request.

Aaron, just a heads up, your changes will likely have to just wait until
the next kernel release, and this is one slightly intrusive change you
can move to its own file as part of your awesome cleanup.

[0] https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git/

Luis

\
 
 \ /
  Last update: 2022-01-12 03:49    [W:0.083 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site