linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luis Chamberlain <mcgrof@kernel.org>
To: "Thomas Weißschuh" <thomas@t-8ch.de>
Cc: Andy Lutomirski <luto@kernel.org>,
	Christian Brauner <christian.brauner@ubuntu.com>,
	Linux API <linux-api@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Jessica Yu <jeyu@kernel.org>
Subject: Re: [RFC] Expose request_module via syscall
Date: Mon, 20 Sep 2021 09:59:18 -0700	[thread overview]
Message-ID: <YUi95tFDWS7oceYP@bombadil.infradead.org> (raw)
In-Reply-To: <8cbf0703-5734-4e92-a6cc-12de69094f95@t-8ch.de>

On Mon, Sep 20, 2021 at 04:51:19PM +0200, Thomas Weißschuh wrote:
> On 2021-09-19T07:37-0700, Andy Lutomirski wrote:
> > On Sun, Sep 19, 2021 at 12:56 AM Thomas Weißschuh <thomas@t-8ch.de> wrote:
> > >
> > > On 2021-09-18T11:47-0700, Andy Lutomirski wrote:
> > > > On Thu, Sep 16, 2021, at 2:27 AM, Christian Brauner wrote:
> > > > > On Wed, Sep 15, 2021 at 09:47:25AM -0700, Andy Lutomirski wrote:
> > > > > > On Wed, Sep 15, 2021 at 8:50 AM Thomas Weißschuh <thomas@t-8ch.de> 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.
> > > > > >
> > > > > > I feel like I'm missing something, and I don't understand the purpose
> > > > > > of this syscall.  Wouldn't the right solution be for the container to
> > > > > > have a stub module loader (maybe doable with a special /sbin/modprobe
> > > > > > or maybe a kernel patch would be needed, depending on the exact use
> > > > > > case) and have the stub call out to the container manager to request
> > > > > > the module?  The container manager would check its security policy and
> > > > > > load the module or not load it as appropriate.
> > > > >
> > > > > I don't see the need for a syscall like this yet either.
> > > > >
> > > > > This should be the job of the container manager. modprobe just calls the
> > > > > init_module() syscall, right?
> > > >
> > > > Not quite so simple. modprobe parses things in /lib/modules and maybe /etc to decide what init_module() calls to do.
> > > >
> > > > But I admit I’m a bit confused.  What exactly is the container doing that causes the container’s copy of modprobe to be called?
> > >
> > > The container is running an instance of the docker daemon in swarm mode.
> > > That needs the "ip_vs" module (amongst others) and explicitly tries to load it
> > > via modprobe.
> > >
> > 
> > Do you mean it literally invokes /sbin/modprobe?  If so, hooking this
> > at /sbin/modprobe and calling out to the container manager seems like
> > a decent solution.
> 
> Yes it does. Thanks for the idea, I'll see how this works out.

Would documentation guiding you in that way have helped? If so
I welcome a patch that does just that.

  Luis

  reply	other threads:[~2021-09-20 18:18 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
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 [this message]
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=YUi95tFDWS7oceYP@bombadil.infradead.org \
    --to=mcgrof@kernel.org \
    --cc=christian.brauner@ubuntu.com \
    --cc=jeyu@kernel.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=thomas@t-8ch.de \
    /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).