Re: [PATCH 1/4] module: add syscall to load module from fd

From: Rusty Russell
Date: Wed Oct 24 2012 - 07:31:06 EST


Lucas De Marchi <lucas.demarchi@xxxxxxxxxxxxxx> writes:
> On Tue, Oct 23, 2012 at 1:42 PM, Kees Cook <keescook@xxxxxxxxxxxx> wrote:
>> On Mon, Oct 22, 2012 at 9:08 PM, Lucas De Marchi
>> <lucas.demarchi@xxxxxxxxxxxxxx> wrote:
>>> sure... but do you realize this will fail in case kernel is checking
>>> module signature and we passed --force to modprobe (therefore mangled
>>> the decompressed memory area)?
>>
>> Hm, yeah, userspace mangling of a module plus signing would fail.
>> Seems like mangling and signing aren't compatible. Doing it in
>> kernel-space (as now written for finit_module) solves that, but it
>> means that now compression isn't possible if you need both signing and
>> mangling.

Signing and mangling are always incompatible, of course.

Compressed modules breaks Kees' (and IMA's) requirement to have an fd
attached, unless the kernel does the decompression. We have that code
already, in fact.

It would be easy to add a config option the recognize the compression
magic and uncompress in-kernel. That would happen after the signature
check, of course, and Just Work.

Cheers,
Rusty.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/