diff options
Diffstat (limited to 'include/linux/ipc_namespace.h')
-rw-r--r-- | include/linux/ipc_namespace.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/include/linux/ipc_namespace.h b/include/linux/ipc_namespace.h index 51952989ad42..a6d1655f9607 100644 --- a/include/linux/ipc_namespace.h +++ b/include/linux/ipc_namespace.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/idr.h> | 5 | #include <linux/idr.h> |
6 | #include <linux/rwsem.h> | 6 | #include <linux/rwsem.h> |
7 | #include <linux/notifier.h> | 7 | #include <linux/notifier.h> |
8 | #include <linux/nsproxy.h> | ||
8 | 9 | ||
9 | /* | 10 | /* |
10 | * ipc namespace events | 11 | * ipc namespace events |
@@ -15,6 +16,7 @@ | |||
15 | 16 | ||
16 | #define IPCNS_CALLBACK_PRI 0 | 17 | #define IPCNS_CALLBACK_PRI 0 |
17 | 18 | ||
19 | struct user_namespace; | ||
18 | 20 | ||
19 | struct ipc_ids { | 21 | struct ipc_ids { |
20 | int in_use; | 22 | int in_use; |
@@ -56,6 +58,8 @@ struct ipc_namespace { | |||
56 | unsigned int mq_msg_max; /* initialized to DFLT_MSGMAX */ | 58 | unsigned int mq_msg_max; /* initialized to DFLT_MSGMAX */ |
57 | unsigned int mq_msgsize_max; /* initialized to DFLT_MSGSIZEMAX */ | 59 | unsigned int mq_msgsize_max; /* initialized to DFLT_MSGSIZEMAX */ |
58 | 60 | ||
61 | /* user_ns which owns the ipc ns */ | ||
62 | struct user_namespace *user_ns; | ||
59 | }; | 63 | }; |
60 | 64 | ||
61 | extern struct ipc_namespace init_ipc_ns; | 65 | extern struct ipc_namespace init_ipc_ns; |
@@ -90,7 +94,7 @@ static inline int mq_init_ns(struct ipc_namespace *ns) { return 0; } | |||
90 | 94 | ||
91 | #if defined(CONFIG_IPC_NS) | 95 | #if defined(CONFIG_IPC_NS) |
92 | extern struct ipc_namespace *copy_ipcs(unsigned long flags, | 96 | extern struct ipc_namespace *copy_ipcs(unsigned long flags, |
93 | struct ipc_namespace *ns); | 97 | struct task_struct *tsk); |
94 | static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) | 98 | static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) |
95 | { | 99 | { |
96 | if (ns) | 100 | if (ns) |
@@ -101,12 +105,12 @@ static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) | |||
101 | extern void put_ipc_ns(struct ipc_namespace *ns); | 105 | extern void put_ipc_ns(struct ipc_namespace *ns); |
102 | #else | 106 | #else |
103 | static inline struct ipc_namespace *copy_ipcs(unsigned long flags, | 107 | static inline struct ipc_namespace *copy_ipcs(unsigned long flags, |
104 | struct ipc_namespace *ns) | 108 | struct task_struct *tsk) |
105 | { | 109 | { |
106 | if (flags & CLONE_NEWIPC) | 110 | if (flags & CLONE_NEWIPC) |
107 | return ERR_PTR(-EINVAL); | 111 | return ERR_PTR(-EINVAL); |
108 | 112 | ||
109 | return ns; | 113 | return tsk->nsproxy->ipc_ns; |
110 | } | 114 | } |
111 | 115 | ||
112 | static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) | 116 | static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) |