[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20090728163835.GA16040@us.ibm.com>
Date: Tue, 28 Jul 2009 09:38:35 -0700
From: Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>
To: Andrew Morton <akpm@...l.org>
Cc: Oleg Nesterov <oleg@...hat.com>,
"Eric W. Biederman" <ebiederm@...ssion.com>, roland@...hat.com,
Oren Laadan <orenl@...columbia.edu>, serue@...ibm.com,
Alexey Dobriyan <adobriyan@...il.com>,
Containers <containers@...ts.linux-foundation.org>,
linux-kernel@...r.kernel.org
Subject: [PATCH] Disable CLONE_PARENT for init
Disable CLONE_PARENT for init.
When global or container-init processes use CLONE_PARENT, they create a
multi-rooted process tree. Besides siblings of global init remain as
zombies on exit since they are not reaped by their parent (swapper). So
prevent global and container-inits from creating siblings.
Changelog[v3]:
- [Roland, Oleg] Simplify comment describing the change
Changelog[v2]:
- Simplify patch description based on comments from Eric Biederman
and Oleg Nesterov.
- [Oleg Nesterov] Use SIGNAL_UNKILLABLE instead of is_global_init()
Signed-off-by: Sukadev Bhattiprolu <sukadev@...ibm.com>
Acked-by: Eric W. Biederman <ebiederm@...ssion.com>
Acked-by: Roland McGrath <roland@...hat.com>
---
kernel/fork.c | 10 ++++++++++
1 file changed, 10 insertions(+)
Index: linux-mmotm/kernel/fork.c
===================================================================
--- linux-mmotm.orig/kernel/fork.c 2009-07-16 10:03:01.000000000 -0700
+++ linux-mmotm/kernel/fork.c 2009-07-16 11:36:28.000000000 -0700
@@ -992,6 +992,16 @@
if ((clone_flags & CLONE_SIGHAND) && !(clone_flags & CLONE_VM))
return ERR_PTR(-EINVAL);
+ /*
+ * Siblings of global init remain as zombies on exit since they are
+ * not reaped by their parent (swapper). To solve this and to avoid
+ * multi-rooted process trees, prevent global and container-inits
+ * from creating siblings.
+ */
+ if ((clone_flags & CLONE_PARENT) &&
+ current->signal->flags & SIGNAL_UNKILLABLE)
+ return ERR_PTR(-EINVAL);
+
retval = security_task_create(clone_flags);
if (retval)
goto fork_out;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists