Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 29 Nov 2017 14:45:35 -0800
From: Linus Torvalds <>
To: David Miller <>
Cc: "Theodore Ts'o" <>, One Thousand Gnomes <>, 
	Kees Cook <>, "Luis R. Rodriguez" <>, 
	Djalal Harouni <>, Andrew Lutomirski <>, 
	Andrew Morton <>, James Morris <>, 
	Ben Hutchings <>, Solar Designer <>, 
	"Serge E. Hallyn" <>, Jessica Yu <>, 
	Rusty Russell <>, 
	Linux Kernel Mailing List <>, 
	LSM List <>, 
	"" <>, Jonathan Corbet <>, 
	Ingo Molnar <>, Network Development <>, 
	Peter Zijlstra <>
Subject: Re: [PATCH v5 next 1/5] modules:capabilities: add request_module_cap()

On Wed, Nov 29, 2017 at 7:58 AM, David Miller <> wrote:
> We're talking about making sure that loading "ppp.ko" really gets
> ppp.ko rather than some_other_module.ko renamed to ppp.ko via some
> other mechanism.
> Both modules have legitimate signatures so the kernel will happily
> load both.

Yes. We could make the module name be part of the signing process, but
one problem with that is that at module loading time we don't actually
have the filename any more.

User space opens the file and then just feeds the data to the kernel.
So if you fooled modprobe into feeding the wrong module, that's it.

And yes, we can obviously embed the module name into the ELF headers
(that is all part of the signed payload), but the module name doesn't
actually necessarily match what we originally asked for.

Why? Module aliases and module dependencies - which is why we have
that user mode side at all. When we do "request_module(XYZ)" we don't
necessarily know what the dependencies are, so we expect modprobe to
just load the right modules.

So if modprobe then loads some other module (dccp or whatever), the
kernel has no real way to know "oh, that wasn't part of the dependency
chain for the module we aked for".

Now, if modprobe is taught to check that the filename of the module
that it opens actually matches the metadata in the ELF sections, that
would solve it, but it's out of the kernels hands..


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.