]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
nsfs: move root inode number to uapi
authorChristian Brauner <brauner@kernel.org>
Fri, 6 Jun 2025 09:45:07 +0000 (11:45 +0200)
committerChristian Brauner <brauner@kernel.org>
Wed, 11 Jun 2025 09:59:08 +0000 (11:59 +0200)
Userspace relies on the root inode numbers to identify the initial
namespaces. That's already a hard dependency. So we cannot change that
anymore. Move the initial inode numbers to a public header.

Link: https://github.com/systemd/systemd/commit/d293fade24b34ccc2f5716b0ff5513e9533cf0c4
Link: https://lore.kernel.org/20250606-work-nsfs-v1-1-b8749c9a8844@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
include/linux/proc_ns.h
include/uapi/linux/nsfs.h

index 5ea470eb4d768ad92f2785187aa9298c39025ea2..e77a37b23ca7ec000481708dfac3ffa69d6d88e1 100644 (file)
@@ -6,6 +6,7 @@
 #define _LINUX_PROC_NS_H
 
 #include <linux/ns_common.h>
+#include <uapi/linux/nsfs.h>
 
 struct pid_namespace;
 struct nsset;
@@ -40,12 +41,12 @@ extern const struct proc_ns_operations timens_for_children_operations;
  */
 enum {
        PROC_ROOT_INO           = 1,
-       PROC_IPC_INIT_INO       = 0xEFFFFFFFU,
-       PROC_UTS_INIT_INO       = 0xEFFFFFFEU,
-       PROC_USER_INIT_INO      = 0xEFFFFFFDU,
-       PROC_PID_INIT_INO       = 0xEFFFFFFCU,
-       PROC_CGROUP_INIT_INO    = 0xEFFFFFFBU,
-       PROC_TIME_INIT_INO      = 0xEFFFFFFAU,
+       PROC_IPC_INIT_INO       = IPC_NS_INIT_INO,
+       PROC_UTS_INIT_INO       = UTS_NS_INIT_INO,
+       PROC_USER_INIT_INO      = USER_NS_INIT_INO,
+       PROC_PID_INIT_INO       = PID_NS_INIT_INO,
+       PROC_CGROUP_INIT_INO    = CGROUP_NS_INIT_INO,
+       PROC_TIME_INIT_INO      = TIME_NS_INIT_INO,
 };
 
 #ifdef CONFIG_PROC_FS
index 34127653fd0070f80cf7cacd0a7c32e63993180e..6683e7ca39960ecdad5241f78ff5d0c9ece3cb06 100644 (file)
@@ -42,4 +42,13 @@ struct mnt_ns_info {
 /* Get previous namespace. */
 #define NS_MNT_GET_PREV                _IOR(NSIO, 12, struct mnt_ns_info)
 
+enum init_ns_ino {
+       IPC_NS_INIT_INO         = 0xEFFFFFFFU,
+       UTS_NS_INIT_INO         = 0xEFFFFFFEU,
+       USER_NS_INIT_INO        = 0xEFFFFFFDU,
+       PID_NS_INIT_INO         = 0xEFFFFFFCU,
+       CGROUP_NS_INIT_INO      = 0xEFFFFFFBU,
+       TIME_NS_INIT_INO        = 0xEFFFFFFAU,
+};
+
 #endif /* __LINUX_NSFS_H */