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=1796094746; b=L37H5IO1TS3yz4bkuX4o9ZeEgtkrtPUZ36bYOV693mNDMo/pXB/BSqauADa/EnE3LkMg IecOmfXWATsfnIIfkYkuto7Q3wq4aAVgqrCxNqWbDNSKguyl75Y4JrpvkGxW6o+XQx74p c+7JrZbXAPiUQHYd6gWPz7JhfA6GeHYxEmierU4nP7Ny7VVPpIEpyTS4xphqVnzuLG/ZR CUXFKRnsDOF6bOloYrnyu5DdFUc6mGu9cOAP3wJnYFfBiUA39Da0yZCLazJ9iAm8OJ+19 +vclF3+oXPx6Agn6ooaYOLfojqKisd9p5IKKW2cuFahpRhwCu+cM5zs7G1TFEkuBVqg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796094746; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=JgUKaNEbuGsSKn0PcWO71B7EAgS6UvSNEjDt/aDZxo8=; b=H8yaGubtQ1c7/DOaizMD35WHnwjiCdRwSAf2g8e4q7vf6JyVRya31yK6NLD2ARpfapFH K6cEFxZe3zRW/ryeWxTjDcpb/+J3ZAEdv1LrXqNAv9eoO6VDud/kLdl6tGZU7YqTw4nsT ZP91vULt5jU5hJ7yOaAw/g9UPrGnsDttjiYj7nxIv/8QQtJhLNHaxlJqNJRVAiJVPm1ha 4A6IgG8k2Nqb1Uq9ke+Ihl5j6KKBtJH+Bu4V7eZ5x8tYlEI0tSb6HlYnNzDlz/gPUGWpM kwXAwKCxWvH4UAiiykxYHCyheCdq0Uoh2VcD4nHV1Db70OyVlRW8hthLPH+vP1i1ucQ== 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=KRaSFRO9; 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 5E489606A6B2; Tue, 1 Dec 2026 03:12:25 +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=KRaSFRO9 Received: by smtp.kernel.org (Postfix) with UTF8SMTPSA id F0CB81F00A17; Tue, 1 Dec 2026 03:12:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796094744; bh=JgUKaNEbuGsSKn0PcWO71B7EAgS6UvSNEjDt/aDZxo8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=KRaSFRO9gQBlDn4OeRgd71g1pN6unhSaHH0boi2cWBsN14/dF8GSHTza2JuBNu2I4 LtUTKxsSHQkgWqDpoGioYGzHFkJ2KjlH1Pbo6wNWTfu1uqIqlyetNT5E2/R1DoheXW L5ELqadaveiSfGo55+uKSlLSDJkgiZafxmjUbVYI1phOIydgysIDSa1lFSXYtZQYWR uU2byUg/NuPeaB8m86ChBNgv08R0HvHtB3CFWpZKUZK9Q/DS1BXtSpLYmrf37x3Nfd o9xuodMYIICguUzIW7kkNsX3zMEi3yIr385d9YJt3Q5nXzacKvzA8X4MKqgnJuH/Lx hEzavjjqKyGJg== From: Jarkko Sakkinen To: fsdevel@vger.kernel.org Cc: Jarkko Sakkinen , 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 , =?UTF-8?q?G=C3=BCnther=20Noack?= , 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 , =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= , 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: [RFC PATCH v9 27/29] docs: Document nsexec uAPI Date: Tue, 1 Dec 2026 05:09:59 +0200 Message-ID: <20261201031002.593830-28-jarkko@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261201031002.593830-1-jarkko@kernel.org> References: <20261201031002.593830-1-jarkko@kernel.org> X-Mailing-List: containers@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Userspace orchestrators need a clear specification of what an nsexec is, its build and live state transitions, NSEXEC_GET_NSFD, NSEXEC_SHARE_NSFD, waitid(P_NSEXEC), pidfd_send_signal(), mount-tree construction, user namespace ID mapping, credential rules, and process creation semantics. Add Documentation/userspace-api/nsexec.rst including the kernel-doc sections, type definitions, ioctl descriptions, and system call reference from include/linux/nsexec.h, include/uapi/linux/nsexec.h, include/uapi/linux/nsfs.h, kernel/nsexec.c, kernel/user_namespace.c, fs/fsopen.c, and fs/namespace.c, and register the nsexec ioctl magic in ioctl-number.rst. Signed-off-by: Jarkko Sakkinen --- Documentation/userspace-api/index.rst | 1 + .../userspace-api/ioctl/ioctl-number.rst | 1 + Documentation/userspace-api/nsexec.rst | 77 +++++++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 Documentation/userspace-api/nsexec.rst diff --git a/Documentation/userspace-api/index.rst b/Documentation/userspace-api/index.rst index a68b1bea57a8..e48d5081bbc2 100644 --- a/Documentation/userspace-api/index.rst +++ b/Documentation/userspace-api/index.rst @@ -17,6 +17,7 @@ System calls :maxdepth: 1 unshare + nsexec futex2 ebpf/index ioctl/index diff --git a/Documentation/userspace-api/ioctl/ioctl-number.rst b/Documentation/userspace-api/ioctl/ioctl-number.rst index dbe462040999..441e4925c9ac 100644 --- a/Documentation/userspace-api/ioctl/ioctl-number.rst +++ b/Documentation/userspace-api/ioctl/ioctl-number.rst @@ -385,6 +385,7 @@ Code Seq# Include File Comments 0xB8 01-02 uapi/misc/mrvl_cn10k_dpi.h Marvell CN10K DPI driver 0xB8 all uapi/linux/mshv.h Microsoft Hyper-V /dev/mshv driver +0xB9 00-0F uapi/linux/nsexec.h nsexec uAPI 0xBA 00-0F uapi/linux/liveupdate.h Pasha Tatashin 0xC0 00-0F linux/usb/iowarrior.h diff --git a/Documentation/userspace-api/nsexec.rst b/Documentation/userspace-api/nsexec.rst new file mode 100644 index 000000000000..81d4352a01a5 --- /dev/null +++ b/Documentation/userspace-api/nsexec.rst @@ -0,0 +1,77 @@ +.. SPDX-License-Identifier: GPL-2.0 + +=========== +nsexec uAPI +=========== + +Overview +======== + +.. kernel-doc:: kernel/nsexec.c + :doc: Overview + +Lifecycle +========= + +.. kernel-doc:: include/linux/nsexec.h + :identifiers: nsexec_state + +Flags +===== + +.. kernel-doc:: include/uapi/linux/nsexec.h + :identifiers: nsexec_flags + +Ioctls +====== + +.. kernel-doc:: include/uapi/linux/nsexec.h + :doc: NSEXEC_GET_NSFD + +.. kernel-doc:: include/uapi/linux/nsexec.h + :doc: NSEXEC_SHARE_NSFD + +System calls +============ + +.. kernel-doc:: kernel/nsexec.c + :identifiers: sys_nsexec_open + +Process creation +================ + +.. kernel-doc:: kernel/nsexec.c + :doc: CLONE_INTO_NSEXEC + +Process waiting +=============== + +.. kernel-doc:: kernel/nsexec.c + :doc: P_NSEXEC + +Signal delivery +=============== + +.. kernel-doc:: kernel/nsexec.c + :doc: pidfd_send_signal + +Filesystem configuration +======================== + +.. kernel-doc:: fs/fsopen.c + :doc: FSCONFIG_SET_NSEXEC + +Mount tree installation +======================= + +.. kernel-doc:: fs/namespace.c + :doc: MOVE_MOUNT_T_MNTNS + +User namespace ID mapping +========================= + +.. kernel-doc:: include/uapi/linux/nsfs.h + :identifiers: userns_idmap_extent userns_flags userns_idmap + +.. kernel-doc:: kernel/user_namespace.c + :identifiers: sys_userns_set_idmap -- 2.47.3