Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp645338pxb; Wed, 15 Sep 2021 09:51:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyepb7hhi2iUYXYWZzz8XVaw/5VCyPcGYQ4HRyUxbHD+y0gTAN9aGZ9VgTbY+X8v0ni0Sz X-Received: by 2002:a05:6402:26c6:: with SMTP id x6mr1041687edd.10.1631724714693; Wed, 15 Sep 2021 09:51:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631724714; cv=none; d=google.com; s=arc-20160816; b=PoKUzI1tVReBMFY2X8VtfEeX+/rQ5TyRGA+cdTf8kSX7GgPo4db81XgsPVYJN+xuOx xKV1Rof6ZDcLKoKXZ2M1UBbmETNMBzNU6C6fv4qoLi4JCfx/+vNqBsIWtyR4tQUGB0gY EUlgi0EvWJtcOiZGrs1DhzVeN8MLr22Km7zThwY1LBdixL21ZU5XcjqkSBzwAPjDONyi sdmiKrnmhIe8egEojmj6Wu6f7BrYK/mV1UVtpnzEQpwDmnWcFSR6EUO6vg4DSLpgh7jv wcpivyXOiQb4ZSVDzOERCMA9dSrK+rk2pH/7XrtsLazclKLEZdKB66V3IrpWtBndTx2a fURg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=YKvzFDP04hKa15XUTStihX8W50utoeMXq86RK+pl7qc=; b=h28CtUSjl+f82FIdXIhNHfAizSe2S/PZ89xsG7xXK5qhRxdRpM0aAATwvf0z8nFjqi YbBADEvEm07n1wRJs+P5T1m/iejXTE/yFunAJDe1EtjcTxQ6zx4m6CintyV8dfcIqLc9 eswNjshBfCC65ptoEtu8tHyd1W4/3mKUd2SEapti2b1Vbw8dsq7Ji82yzXP9P9gqxZHc F2viWZtIAX4MpardXzn7+UsxpHHUB7x3gevoA539T3NWOq/xarsEmAfVqTVHsp6ffWjX CT1j52Ad2vs/TZ85KxkwXWKW0X/7WGTsGn9NCqnjqy+uVBNjQTdTRptbg2xRTHiv4vdV D6dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=j05dwuut; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w25si510961edr.441.2021.09.15.09.51.30; Wed, 15 Sep 2021 09:51:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=j05dwuut; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229697AbhIOQs7 (ORCPT + 99 others); Wed, 15 Sep 2021 12:48:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:49170 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229489AbhIOQs6 (ORCPT ); Wed, 15 Sep 2021 12:48:58 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B0EDE610E9 for ; Wed, 15 Sep 2021 16:47:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631724459; bh=RXpsF/VO6GEdjb1aQhtYiJKHMct/U0k37GgDFDGgrR4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=j05dwuutr3ixumWPZWdZIcn+eEOt/vnSb1TnGP9o2pp+YwKIGCoNzYsjFCOUVo4pz WjPRbZJqT4GU1lVr/pFLN4xZnFgWQxLEbPPm6waSRAsmR7qGtgkvSdod5R14MlWOjd PMnpP7w1LZK4hxdH7iLxck8zaw3Hw9lZ5SZBQqOSLbNuPtuRvBWgPtgeBu101aaefw qr1jO7Jlu0/UrCsWuOSXL8YoCi58n24Pb/MD5PEz4MFJctJrqxlXfPL+vKQiQPWz8E KKagKKIwaKxlQOh6TIxx73aYyPRl5gleaZZw6jpUPwPFl184cl6+hJZ0w5ueCozUll GyqVDHQy2Dg3g== Received: by mail-ed1-f50.google.com with SMTP id v22so1763216edd.11 for ; Wed, 15 Sep 2021 09:47:39 -0700 (PDT) X-Gm-Message-State: AOAM531PgMxPWfyILbGKJMHWUeKPT9jbD7FxoyScjnCG2e9WLPbLHyIj OhpnyDxnlRdN3BUcyAMA/WsgRdu4ZIit6RuU4RECag== X-Received: by 2002:a17:906:1557:: with SMTP id c23mr926887ejd.371.1631724458312; Wed, 15 Sep 2021 09:47:38 -0700 (PDT) MIME-Version: 1.0 References: <705fde50-37a6-49ed-b9c2-c9107cd88189@t-8ch.de> In-Reply-To: <705fde50-37a6-49ed-b9c2-c9107cd88189@t-8ch.de> From: Andy Lutomirski Date: Wed, 15 Sep 2021 09:47:25 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC] Expose request_module via syscall To: =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= Cc: Linux API , LKML , Luis Chamberlain , Jessica Yu Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 15, 2021 at 8:50 AM Thomas Wei=C3=9Fschuh wro= te: > > 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 fla= gs); > 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 modul= es. > 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. --Andy