]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - include/linux/ipc_namespace.h
userns: user namespaces: convert several capable() calls
[mirror_ubuntu-bionic-kernel.git] / include / linux / ipc_namespace.h
index d3c32dcec62399055100ea3e8c3f54ee07329030..a6d1655f9607de872a10fecaa744e38412c8edb2 100644 (file)
@@ -5,6 +5,7 @@
 #include <linux/idr.h>
 #include <linux/rwsem.h>
 #include <linux/notifier.h>
+#include <linux/nsproxy.h>
 
 /*
  * ipc namespace events
@@ -93,7 +94,7 @@ static inline int mq_init_ns(struct ipc_namespace *ns) { return 0; }
 
 #if defined(CONFIG_IPC_NS)
 extern struct ipc_namespace *copy_ipcs(unsigned long flags,
-                                      struct ipc_namespace *ns);
+                                      struct task_struct *tsk);
 static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns)
 {
        if (ns)
@@ -104,12 +105,12 @@ static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns)
 extern void put_ipc_ns(struct ipc_namespace *ns);
 #else
 static inline struct ipc_namespace *copy_ipcs(unsigned long flags,
-               struct ipc_namespace *ns)
+                                             struct task_struct *tsk)
 {
        if (flags & CLONE_NEWIPC)
                return ERR_PTR(-EINVAL);
 
-       return ns;
+       return tsk->nsproxy->ipc_ns;
 }
 
 static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns)