public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] PID namespace design bug, workaround
@ 2007-11-01 14:43 Ingo Molnar
  2007-11-01 14:51 ` Pavel Emelyanov
                   ` (2 more replies)
  0 siblings, 3 replies; 41+ messages in thread
From: Ingo Molnar @ 2007-11-01 14:43 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton
  Cc: linux-kernel, Ulrich Drepper, Pavel Emelyanov


while checking recent commits to the kernel core i took a look at the 
PID namespaces implementation, and it has a fatal flaw: it breaks 
futexes and various libraries (and other stuff) that use PIDs as the 
means of identifying tasks, by not providing any means of global 
identification that works across PID namespaces. (PIDs _are_ a very 
convenient and global way of identifying contexts.)

i asked Ulrich about this and it turns out he has warned about this 
early on:

  http://www.nabble.com/Re%3A-question%3A-pid-space-semantics.-p3409990.html

but this problem is still present in the code, and it has been recently 
committed into mainline via:

  commit 30e49c263e36341b60b735cbef5ca37912549264
  Author: Pavel Emelyanov <xemul@openvz.org>
  Date:   Thu Oct 18 23:40:10 2007 -0700

      pid namespaces: allow cloning of new namespace

without these problems having been resolved. A full-scale revert is 
probably too intrusive, but at minimum we need to turn off user-space 
access to this feature via this simple patch. Until this issue is 
resolved properly the new PID namespace code needs to be turned off. 
Letting this into 2.6.24 would be a disaster.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 kernel/fork.c |    8 ++++++++
 1 file changed, 8 insertions(+)

Index: v/kernel/fork.c
===================================================================
--- v.orig/kernel/fork.c
+++ v/kernel/fork.c
@@ -1420,6 +1420,14 @@ long do_fork(unsigned long clone_flags,
 	int trace = 0;
 	long nr;
 
+	/*
+	 * PID namespaces are broken at the moment: they do not allow
+	 * certain PID based syscalls (such as futexes) to be used
+	 * across namespaces. This is broken and must not be allowed,
+	 * so we keep this feature turned off until it's properly fixed.
+	 */
+	clone_flags &= ~CLONE_NEWPID;
+
 	if (unlikely(current->ptrace)) {
 		trace = fork_traceflag (clone_flags);
 		if (trace)

^ permalink raw reply	[flat|nested] 41+ messages in thread

end of thread, other threads:[~2007-11-21  6:42 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-01 14:43 [patch] PID namespace design bug, workaround Ingo Molnar
2007-11-01 14:51 ` Pavel Emelyanov
2007-11-01 14:56   ` Peter Zijlstra
2007-11-01 15:06     ` Pavel Emelyanov
2007-11-01 15:17       ` Ingo Molnar
2007-11-01 15:30         ` Pavel Emelyanov
2007-11-01 14:56   ` Ulrich Drepper
2007-11-01 15:05     ` Pavel Emelyanov
2007-11-02  0:21       ` Ulrich Drepper
2007-11-02  7:55         ` Pavel Emelyanov
2007-11-02  8:04           ` Andrew Morton
2007-11-02  8:14             ` Pavel Emelyanov
2007-11-02 14:05               ` Ulrich Drepper
2007-11-02 14:21                 ` Pavel Emelyanov
2007-11-02 15:34                   ` Ulrich Drepper
2007-11-02 15:58                     ` Pavel Emelyanov
2007-11-02 21:39                       ` Theodore Tso
2007-11-03  4:34                       ` Ulrich Drepper
2007-11-06  7:49                         ` Pavel Emelyanov
2007-11-03 20:01                   ` sukadev
2007-11-04  7:17                     ` Eric W. Biederman
2007-11-02 17:30             ` Dave Hansen
2007-11-02 17:39               ` Linus Torvalds
2007-11-03  4:02                 ` Nicholas Miell
2007-11-03 20:12                 ` Ingo Molnar
2007-11-03 22:40                   ` Linus Torvalds
2007-11-03 23:55                     ` Arjan van de Ven
2007-11-04  0:21                       ` david
2007-11-04 10:38                     ` [patch] PID namespaces Ingo Molnar
2007-11-04 20:12                       ` Dave Hansen
2007-11-05 14:47                       ` Denys Vlasenko
2007-11-20 22:53                   ` Futexes and network filesystems Er ic W. Biederman
2007-11-21  6:16                     ` Kyle Moffett
2007-11-21  6:30                       ` Eric W. Biederman
2007-11-01 16:12     ` [patch] PID namespace design bug, workaround Dave Hansen
2007-11-01 14:53 ` Ulrich Drepper
2007-11-01 15:05   ` Ingo Molnar
2007-11-01 18:57     ` Theodore Tso
2007-11-01 19:53       ` Ingo Molnar
2007-11-02  0:23         ` Ulrich Drepper
2007-11-01 15:02 ` Pavel Emelyanov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox