hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/include/linux/proc_ns.h
....@@ -8,7 +8,7 @@
88 #include <linux/ns_common.h>
99
1010 struct pid_namespace;
11
-struct nsproxy;
11
+struct nsset;
1212 struct path;
1313 struct task_struct;
1414 struct inode;
....@@ -19,7 +19,7 @@
1919 int type;
2020 struct ns_common *(*get)(struct task_struct *task);
2121 void (*put)(struct ns_common *ns);
22
- int (*install)(struct nsproxy *nsproxy, struct ns_common *ns);
22
+ int (*install)(struct nsset *nsset, struct ns_common *ns);
2323 struct user_namespace *(*owner)(struct ns_common *ns);
2424 struct ns_common *(*get_parent)(struct ns_common *ns);
2525 } __randomize_layout;
....@@ -32,6 +32,8 @@
3232 extern const struct proc_ns_operations userns_operations;
3333 extern const struct proc_ns_operations mntns_operations;
3434 extern const struct proc_ns_operations cgroupns_operations;
35
+extern const struct proc_ns_operations timens_operations;
36
+extern const struct proc_ns_operations timens_for_children_operations;
3537
3638 /*
3739 * We always define these enumerators
....@@ -43,19 +45,15 @@
4345 PROC_USER_INIT_INO = 0xEFFFFFFDU,
4446 PROC_PID_INIT_INO = 0xEFFFFFFCU,
4547 PROC_CGROUP_INIT_INO = 0xEFFFFFFBU,
48
+ PROC_TIME_INIT_INO = 0xEFFFFFFAU,
4649 };
4750
4851 #ifdef CONFIG_PROC_FS
4952
50
-extern int pid_ns_prepare_proc(struct pid_namespace *ns);
51
-extern void pid_ns_release_proc(struct pid_namespace *ns);
5253 extern int proc_alloc_inum(unsigned int *pino);
5354 extern void proc_free_inum(unsigned int inum);
5455
5556 #else /* CONFIG_PROC_FS */
56
-
57
-static inline int pid_ns_prepare_proc(struct pid_namespace *ns) { return 0; }
58
-static inline void pid_ns_release_proc(struct pid_namespace *ns) {}
5957
6058 static inline int proc_alloc_inum(unsigned int *inum)
6159 {
....@@ -76,12 +74,14 @@
7674
7775 extern struct file *proc_ns_fget(int fd);
7876 #define get_proc_ns(inode) ((struct ns_common *)(inode)->i_private)
79
-extern void *ns_get_path(struct path *path, struct task_struct *task,
77
+extern int ns_get_path(struct path *path, struct task_struct *task,
8078 const struct proc_ns_operations *ns_ops);
8179 typedef struct ns_common *ns_get_path_helper_t(void *);
82
-extern void *ns_get_path_cb(struct path *path, ns_get_path_helper_t ns_get_cb,
80
+extern int ns_get_path_cb(struct path *path, ns_get_path_helper_t ns_get_cb,
8381 void *private_data);
8482
83
+extern bool ns_match(const struct ns_common *ns, dev_t dev, ino_t ino);
84
+
8585 extern int ns_get_name(char *buf, size_t size, struct task_struct *task,
8686 const struct proc_ns_operations *ns_ops);
8787 extern void nsfs_init(void);