linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Thomas Weißschuh" <thomas@t-8ch.de>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: linux-api@vger.kernel.org, linux-kernel@vger.kernel.org,
	Luis Chamberlain <mcgrof@kernel.org>,
	Jessica Yu <jeyu@kernel.org>
Subject: Re: [RFC] Expose request_module via syscall
Date: Wed, 15 Sep 2021 18:28:27 +0200	[thread overview]
Message-ID: <3750b26b-f12e-4d05-b369-84e4c0ca95ee@t-8ch.de> (raw)
In-Reply-To: <YUIZKagx0bjJ3PEm@kroah.com>

On 2021-09-15T18:02+0200, Greg KH wrote:
> On Wed, Sep 15, 2021 at 05:49:34PM +0200, Thomas Weißschuh wrote:
> > Hi,
> > 
> > I would like to propose a new syscall that exposes the functionality of
> > request_module() to userspace.
> > 
> > Propsed signature: request_module(char *module_name, char **args, int flags);
> > Where args and flags have to be NULL and 0 for the time being.
> > 
> > Rationale:
> > 
> > We are using nested, privileged containers which are loading kernel modules.
> > Currently we have to always pass around the contents of /lib/modules from the
> > root namespace which contains the modules.
> > (Also the containers need to have userspace components for moduleloading
> > installed)
> > 
> > The syscall would remove the need for this bookkeeping work.
> 
> So you want any container to have the ability to "bust through" the
> containers and load a module from the "root" of the system?

Only those with CAP_SYS_MODULE.
Having this capability would also allow them load the module normally when
mounted in or potentially downloaded from the internet.

> That feels dangerous, why not just allow a mount of /lib/modules into
> the containers that you want to be able to load a module?

This is what we are currently doing. But sometimes this gets forgotten at some
point in the chain of nested containers/namespaces and things break.

> Why are modules somehow "special" here, they are just a resource that
> has to be allowed (or not) to be accessed by a container like anything
> else on a filesystem.

They are special insofar as they always have to match the running kernel.
Which is managed by the root namespace.

The biggest problems would probably arise if the root namespace has non-standard
modules available which the container would normally not have access to.

I think this is a big potential problem and which would not be justified by the
quality of life improvement.

Sorry for the noise.

Thomas

  reply	other threads:[~2021-09-15 16:28 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-15 15:49 [RFC] Expose request_module via syscall Thomas Weißschuh
2021-09-15 16:02 ` Greg KH
2021-09-15 16:28   ` Thomas Weißschuh [this message]
2021-09-15 16:47 ` Andy Lutomirski
2021-09-16  9:27   ` Christian Brauner
2021-09-18 18:47     ` Andy Lutomirski
2021-09-19  7:56       ` Thomas Weißschuh
2021-09-19 14:37         ` Andy Lutomirski
2021-09-20 14:51           ` Thomas Weißschuh
2021-09-20 16:59             ` Luis Chamberlain
2021-09-20 18:36               ` Andy Lutomirski
2021-09-22 12:25                 ` Christian Brauner
2021-09-22 15:34                   ` Andy Lutomirski
2021-09-22 15:52                     ` Christian Brauner
2021-09-22 20:06                       ` Andy Lutomirski
2021-09-24 13:19                         ` Christian Brauner
2021-09-24 23:04                           ` Andy Lutomirski
2021-10-24  9:38         ` Thomas Weißschuh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3750b26b-f12e-4d05-b369-84e4c0ca95ee@t-8ch.de \
    --to=thomas@t-8ch.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=jeyu@kernel.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).