From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796502503; b=P/xKSxhDR7SNiBHG0kEG5gbFQ4oIrQijUTy+KYIkmYg05JdP9a2BlU2Uc716Q3PWCfmE PvfakhyHZkz4SikovU2IcU0qaBXU0mGHg8l2Yz/+oTwVi+4QSXRwGEF6gS1/CUCvw8akz SXocMOv9jt7TZfDvc/LvKFMS/wDqKTBaw6LIXbLQhJGE3/49Wy7bkXz4K7lPefUzxY9rF DR9OVrEURxovVNd5Rf5a/FrmiYqliFlI4F82RHBOqJZZRmCMYCM+eaH6upm4SIRpR1e/E G+GCUprwCrlolxlEXnyO7+IctEUsGvm9vChgyKmQ8OzS8rtYWUFVOj/jBWmkVr7/9qg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796502503; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; bh=T/+VNwhKm8oWtOqIdKhMgn9W+TB9VN3yMAr4utICN6g=; b=bVjSVRG01ToaKgIS1DCSW9YOXGBKYgZhmXZEChDFPlBgZJdSQRGPpAdhZ+2c8qtgp3pP AE4LJILyCBiEWCXunJaQLiiXYH009MS7qhJ3VYbr21b/8wL9BqNR6t7B5UlGM40f/8Bgn ejGPu6s3xJqdDrHoPpYrkdClW6/Dsf70TFEE861TQvIAmPp9uU7jo//s92MJ1Mlc8SeyX e28dgKePbbs0c3IVvtwZYlJkUUT/o3AGojbxh9VvlS6WD9rH97ZaEUYEG8dZxmdCmAdEU T7ZkstDMVFjavP9DC1l+jiU0jKbbvAqVBR5cEf/IF8NM22fj8M1vRRaIBWqk+LIZK/g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fJOkTXsc; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with UTF8SMTPS id A460A606A31F; Sat, 5 Dec 2026 20:28:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fJOkTXsc Received: by smtp.kernel.org (Postfix) with UTF8SMTPSA id 85B0D1F0092B; Sat, 5 Dec 2026 20:28:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796502503; bh=T/+VNwhKm8oWtOqIdKhMgn9W+TB9VN3yMAr4utICN6g=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=fJOkTXsc7AYMluwbDRLy/ceyCvIWvbSUFOosVaxG2tcBqg0Q+6vJEJj0CYUITTza6 ozrAtfYVTb2b/CQhfXzFDw816JsbofXjesKwg0+jKYDwxAZYYcGaFUHSpB3Z+8bc2H EYSb93/0RgYq1Gh6jkw/u30qvRTRFTHVhu7wHSGqfAhHoo84uhHkIFAzjHVQ5t4KnI 5OX01F0VXdiZuzMbM4OrgV7eurwYdb0sKRF16KDIvnFXJXkQJCgpombwZiFyVEX2HM ipx39+r0DF6yu2/AUtuxUHNLi1VLSoA/r+lD+NePgxsluq2fM7O0typ8WpcCkf1Ww6 Pa6qG0Pw8Ya4Q== Date: Sat, 5 Dec 2026 22:28:19 +0200 From: Jarkko Sakkinen To: fsdevel@vger.kernel.org Cc: bpf@vger.kernel.org, containers@lists.linux.dev, linux-api@vger.kernel.org, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, linux-security-module@vger.kernel.org, Aleksa Sarai , Alexander Mikhalitsyn , Alexander Viro , Alexei Starovoitov , Andrew Morton , Andrii Nakryiko , Andy Lutomirski , Arnd Bergmann , Baolin Wang , Ben Segall , Christian Brauner , Daniel Borkmann , David Hildenbrand , David Howells , David Woodhouse , Davidlohr Bueso , Dietmar Eggemann , Eduard Zingerman , Emil Tsalapatis , Eric Biggers , Georgia Garcia , Giuseppe Scrivano , =?iso-8859-1?Q?G=FCnther?= Noack , Hugh Dickins , Ihor Solodrai , Ingo Molnar , James Morris , Jan Kara , Jason Gunthorpe , Jeff Layton , Jiri Olsa , John Johansen , Jonathan Corbet , Josef Bacik , Juri Lelli , Kees Cook , K Prateek Nayak , KP Singh , Kumar Kartikeya Dwivedi , Lennart Poettering , "Liam R. Howlett" , Manfred Spraul , Martin KaFai Lau , Matt Bobrowski , Mel Gorman , Michal Hocko , =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= , Mike Rapoport , Neal Gompa , Oleg Nesterov , Paul Moore , Pavel Tikhomirov , Peter Zijlstra , Randy Dunlap , "Serge E. Hallyn" , Serge Hallyn , Shuah Khan , Song Liu , Stephen Smalley , Steven Rostedt , Valentin Schneider , Vincent Guittot , Yonghong Song , Zygmunt Krynicki Subject: Re: [RFC PATCH v10 00/28] runfd: Staged namespace execution Message-ID: References: <20261205032633.1702772-1-jarkko@kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Sat, Dec 05, 2026 at 08:53:26PM +0200, Jarkko Sakkinen wrote: > On Sat, Dec 05, 2026 at 06:56:49PM +0200, Jarkko Sakkinen wrote: > > On Sat, Dec 05, 2026 at 05:26:05AM +0200, Jarkko Sakkinen wrote: > > > v10: > > > - Reduced to *SINGLE* new syscall. > > > - Rename nsexec_open() to runfd() and update the related interface names. > > > - Replace userns_set_idmap() with the NS_SET_IDMAP ioctl on the user > > > namespace descriptor. > > > - Drop the in-tree nsexec selftests and package the standalone ucells > > > runner in the Buildroot runfd image. > > > - Include the runfd kernel-doc in the userspace API manual and register > > > the ioctl range in a separate patch. > > > > LSM pollution is the next potential target of redundancy now that > > syscall pollution has been fully addressed. > > > > At least these are low-hanging fruit: > > > > 1. security_runfd_free() is redundant against namespace_free(). > > 2. security_runfd_share() should be replaced a shared hook with > > Landlock, which already contains an equal hook. > > > > I'll address this and then I don't know i.e., need to see first > > how LSM surface appears after these updates. > > > > My goal is to squeeze this patch set around 2000 LOC but not > > sure if that is possible :-) A realistic bet would be something > > like 2300 LOC of added complexity but let's see how this goes. > > After: > > 85 files changed, 2446 insertions(+), 267 deletions(-) > > That's ~100 insertions of complexity reduction. > > I'll look the remaining LSM surface and try to see if they can be > tackled; or do they stick. Less is definitely more here. This is the refined set of hooks and I think all have a place in the life-cycle: - runfd_alloc(): authorize creating a run. - runfd_clone(): authorize spawning into a specific run. - namespace_use(): - RUNFD_SHARE_NSFD: check whether the caller may add the namespace to the run. - clone3(CLONE_INTO_RUN): check whether the caller may enter each destination namespace it isn’t already in. Only by a pure guess, I'd expect security vulnerabilities appearing if namesace_use() is not invoked both at the time of namespace addition and entrance. It's a clean LSM surface as far as I'm concerned. Br, Jarkko