Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.6.26-rc1 /kernel/nsproxy.c

Filename:/kernel/nsproxy.c
Lines Added:12
Lines Deleted:0
Also changed in: (Previous) 2.6.25-git20  2.6.25-git19  2.6.25-git18  2.6.25-git17  2.6.25-git16  2.6.25-git15 
(Following) 2.6.26-rc2  2.6.26-rc3  2.6.26-rc4  2.6.26-rc5  2.6.26-rc6  2.6.26-rc7 

Location
[  2.6.26-rc1
  [  kernel
     o  nsproxy.c

Patch

diff --git a/kernel/nsproxy.c b/kernel/nsproxy.c
index f5d332c..adc7851 100644
--- a/kernel/nsproxy.c
+++ b/kernel/nsproxy.c
@@ -139,6 +139,18 @@ int copy_namespaces(unsigned long flags, struct task_struct *tsk)
       goto out;
    }
 
+   /*
+    * CLONE_NEWIPC must detach from the undolist: after switching
+    * to a new ipc namespace, the semaphore arrays from the old
+    * namespace are unreachable.  In clone parlance, CLONE_SYSVSEM
+    * means share undolist with parent, so we must forbid using
+    * it along with CLONE_NEWIPC.
+    */
+   if ((flags & CLONE_NEWIPC) && (flags & CLONE_SYSVSEM)) {
+      err = -EINVAL;
+      goto out;
+   }
+
    new_ns = create_new_namespaces(flags, tsk, tsk->fs);
    if (IS_ERR(new_ns)) {
       err = PTR_ERR(new_ns);


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.