hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/include/linux/nsproxy.h
....@@ -35,11 +35,37 @@
3535 struct mnt_namespace *mnt_ns;
3636 struct pid_namespace *pid_ns_for_children;
3737 struct net *net_ns;
38
+ struct time_namespace *time_ns;
39
+ struct time_namespace *time_ns_for_children;
3840 struct cgroup_namespace *cgroup_ns;
3941 };
4042 extern struct nsproxy init_nsproxy;
4143
4244 /*
45
+ * A structure to encompass all bits needed to install
46
+ * a partial or complete new set of namespaces.
47
+ *
48
+ * If a new user namespace is requested cred will
49
+ * point to a modifiable set of credentials. If a pointer
50
+ * to a modifiable set is needed nsset_cred() must be
51
+ * used and tested.
52
+ */
53
+struct nsset {
54
+ unsigned flags;
55
+ struct nsproxy *nsproxy;
56
+ struct fs_struct *fs;
57
+ const struct cred *cred;
58
+};
59
+
60
+static inline struct cred *nsset_cred(struct nsset *set)
61
+{
62
+ if (set->flags & CLONE_NEWUSER)
63
+ return (struct cred *)set->cred;
64
+
65
+ return NULL;
66
+}
67
+
68
+/*
4369 * the namespaces access rules are:
4470 *
4571 * 1. only current task is allowed to change tsk->nsproxy pointer or