From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7BE00606A31F for ; Sat, 5 Dec 2026 22:32:17 +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 kanga.kvack.org (Postfix) id 253116B00EF; Sat, 5 Dec 2026 17:32:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2036C6B05B1; Sat, 5 Dec 2026 17:32:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0F2EB6B05B2; Sat, 5 Dec 2026 17:32:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id CF52A6B00EF for ; Sat, 5 Dec 2026 17:32:14 -0500 (EST) Received: from smtpin14.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 9D275160717 for ; Sat, 5 Dec 2026 22:32:12 +0000 (UTC) X-FDA: 85511378904.14.F230E67 Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by imf04.hostedemail.com (Postfix) with ESMTP id E967840009 for ; Sat, 5 Dec 2026 22:32:10 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=kCUWSCr5; spf=pass (imf04.hostedemail.com: domain of jarkko@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=jarkko@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1796509931; b=zyI0MtKCTUuCvMvsYCgLgGAuuGruAiWfmvRYewnJy381v4fjq0uCm/FfKIm0WS/IY1P2uP EtfYlZNrNpvvnfviokC63uzU5XKW1tEz442YLVAB+BolXOf2ChV+zBuxmPisiFQWyZbZiI GKkzE+PXhrMekU9REbCj97XzD+xFFuc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1796509931; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=qexlvZpNzl/WfMCfMB7UMjCYQgimwGn/ZILD8RoLZKk=; b=jzIughka8bltO+EKoxkURzWK11SihIv9wO00SEin1tgMfPquwOyYkDvUXtGXgZhhTT+QM1 hmgyd6mSip4pcLBQaJTb582ij3DPXqNUfrhzj/mJ0iOkBHHwCPRAFRLhMtbFLoGWf5tOM3 q7m9AtpekflsrmrSmJKtjlFKGOeY8Mo= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=kCUWSCr5; spf=pass (imf04.hostedemail.com: domain of jarkko@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=jarkko@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with UTF8SMTP id 761DE600BD; Sat, 5 Dec 2026 22:32:10 +0000 (UTC) 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-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: E967840009 X-Rspam-User: X-Stat-Signature: 1uyzfwqjrmkh145nnugjb8wro7ufzd3m X-Spam-Status: No, score=-6.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-HE-Tag: 1796509930-965766 X-HE-Meta: U2FsdGVkX1/6hu29A5oeodHKJ8Tvh8H/P75t81qR/5L1oWMMK2BrTPS1FrRUxVxYxMQheWAFQxjo92v72zzSnMBSc65csHK2b4mBvptwoop5xS4/LGLHHxaWUnyzpQz2ceDQqe8966+jd2P3Fg0yJr5/4evrLwOdZgFbyUxxvR1Cb7PqQvZxmMqgy5NEQViDUEkOw4pcqavYnjpIBmhg5O05umSSxFoasOwtSrKenEMHGCW4m2RQntwrqP/D9L6rbryTHbW7Jj39Nk/R+0a28YCECYhx+QYFB43i1I6GKHf0/ySr+ec8+cqJEQHZY4CEq+3c6UYJoTB4r+jcErD6W3fmp7aTpHO984PZ19qgtjpnqdgJVzefT0HBAGFU3VqZYPkjewTQI+d2Ea+2SJj6xrv6HaxyoQxXqwq37yBDgOCD/yFyZHlDqaJEZhHXwOIIWyTshiNS5cxRMONbyEnqourdEjD9yqZaSHSFYWQlCNFhuSX2ZOebqfoDdE2Yt9bBXU/4WibfCVcilTokzHrbYqvvqcBF6jQgmjJ7ek34bBwUbnsdjIsO9kqJYcGkFBljlt1dmofGacRpAQF5xKku6ZrTD4rQsb5ZyppGEu+lm2n7KWe1JBaJ8eFT/XuE6lU8KYNcJ+g2zEYVreGWzJka3XDxr76Ito3/6PUBlZB7qFq9HVJs7Fk8VJPu3AYpF9AZDMz8p2q6UVYOZA5qyPxlycpyQ6Q+8JrM7MfzD9e9nLyqu/L/RNat2kJbr6P15d5x87eYPzNOCbXCXJSY1omoavzbvjBmWdLvukzID8uipxQL1h4ZpgT8atW4lT2upkK/a7lWNwG1BPhuPBazz6GxpaLdQlwcX8YXb+DQb/IInOa1F/Bo/w6OL0FJvvVekZWoorDlLmwf9DSbCDF0GmuvVDojcWomI8nsmo9Z/5OUwQblbJPu+Mbb1ui1T5dZmDnUN5BzOFcgvNZ/vv7Jkzm fB38sKwA gWQw2ZN/56WAE546FLzsnzQ9xRoeIAwYXig4iAo11q7t8a1pOWEwVgwHrIoxasVM99Z1r/6FSPeLeSBf7oX3PxmdBYmDGKivE8YNwv8ztlsW0Std94xQxLAO8vwR/RR1xum16qCPZF0AAlzs20vWqtl5QMlWyC3BHyfBSXRNRVd4wbS2GDTa38hsOGUgwzY65gGxQSDOP33DimxRytFHmM6D8RTlgWkFO/hoS9kWCYtpH1qLsNwsRS9HF+VLdNCgQXYJJzAvRJ6wGx0XzgdTnbXkfezR47RYhSCDf6q5SgMegXE0GOS8Jcuu8Edb0IzF9EkTp4HRdJU56nJhmAZx/Cm3DMQJEJANub4HiYhdjqfDZacIzRLMdEMs86SnSAbnDj3F0yHJDOK+JkeWvqAQDReKkOPOF8t+rg7B3aU4Mb4v3IWzXnHCAdSfzhDmd6zu3TBwjuZZOik4zkOtTOeUDjny0+56bkV1E4z2DSFJ8SmtWCZXehibg+cZbjmEw4TYb3aI0H3c67D4YypQidImvdJXzRYxJwL9gaPPl Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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