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=1796509930; b=nxF2QrrCNOr1tJ/OmlIaJeIQvdb5l4WgqG8veDiftop+T2tzwdMvQpD/d5/nXc/Ox33O TAmqljA1WmZ93xlDy5elMDmZQfU2SSWvMJyJAF57126slnt6Ihg32k/yEKWVGYlNn7Ifz Of+g4q6+ENUeHEG2x3Y6kD5sKul5AjV/tkRf9/CJkiPwmOj3nkTI9P85XtOXAadDNyfTO PhXGny6D5cGiQZHbTwEBEFFFBGGSmqzjpn30GXngVLhl13dS7oloJNQoLgRpTC8+hvFso rP4dmIo1LEC03/rJCNA92rYFdBJ9THU22jm+P9hITRm/DEixnbHurFkhuZE6PTBiP+A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796509930; 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=qexlvZpNzl/WfMCfMB7UMjCYQgimwGn/ZILD8RoLZKk=; b=jaSf8PUh1Vi/Px4nSqHnzvWQjYt2ebWoDiE4YnUjrlaCY6yICrC5GHpz2IYVujzWui/E orvixBi3jtG/MqzEFwBTtlKlzCsG9ZKLAJBbkAjuf7D9ldqKjakJD+L1WJY9xwGFQaAIS 8A1cD+8IqfPo8JxjZZqrCilMYs4Mf3VknSFq9VDxUo7/pIZgTFv/8sp3Y/trNQSx/PSYv 4tslEJf5aUWK4hdJ7RMUOojIzZyUaZTR5WfJhYO9GBRiTvt2CBFv1ObIG2rYFoHnyGiL8 q2Xvs7HoHkYCjA3MYBVFiwXQurnJqa/MtmeGazOeBJgYR1kSGee+htnFWhb7GcSfaHg== 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=kCUWSCr5; 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 8A4ED606A31F; Sat, 5 Dec 2026 22:32:10 +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=kCUWSCr5 Received: by smtp.kernel.org (Postfix) with UTF8SMTPSA id 71CF81F0092B; Sat, 5 Dec 2026 22:32:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796509930; bh=qexlvZpNzl/WfMCfMB7UMjCYQgimwGn/ZILD8RoLZKk=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=kCUWSCr5HLLBUYXXP5RCNfBt0jko7J3jvoSgT9/6oQNnJe2wUxjRqKBN+LQm0akgI ce/0mvCbmNmpkJRdmhM69XuonbliitPO6j4qo7Ys0CqbN7TQaKFutHc3TMXDUWI7+H /pWfzyywZuvxmiAL8wBjFW9ZTXnpA9sw3T3/ASWChGCnO9t9Eldd8o5yDRvYmrgxp7 RKa//JWi/T3TbTSI1L9RUauESxmMn9HaAD0eft9+FW+KkOn2zNVv3m6APqRiKnZd/c jgAPiwPjHQxx2yrNNOU3lY7+nFheQodh4ziio7Ts4aAQ+kIvhcFv1bmOB2F5UtmD89 nlvg8dyhYKLIg== Date: Sun, 6 Dec 2026 00:32:06 +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: bpf@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 10:28:23PM +0200, Jarkko Sakkinen wrote: > 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. A new OCI monitor is not required as runfd() can be supplemented into any pre-existing container build flow when the syscall is available. In order to address the thread scenario that agents impose in the actual sense of the word we need to count in SystemD and all the possible crazy ways namespaces and other shenanigans are used at wild so that anything can be patchable. This is a consequence of steep decrease in the price of the cybercrime activities for relatively obscure targets that might have only a few users but the assets might still be mission critical (for a company or for society). SystemD focused, or policy-focused designs, will inevitably leave this territory vulnerable. E.g., Landstrip is sort of niche but it is still widely used in Pi and OpenCode communities, and I've heard that it is even standardized tool in some university departments. The user base is not comparable to SystemD but it might still be part of protecting value assets for companies and educational insititutes. Br, Jarkko