aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2010-05-26 17:43:21 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-27 12:12:47 -0400
commit6e1be45aa6ba6a36c0312f65ecf311135c73001d (patch)
tree3ea540e0ee249259e40e26c38215981b466075ad
parent97101eb41d0d3c97543878ce40e0b8a8b2747ed7 (diff)
check_unshare_flags: kill the bogus CLONE_SIGHAND/sig->count check
check_unshare_flags(CLONE_SIGHAND) adds CLONE_THREAD to *flags_ptr if the task is multithreaded to ensure unshare_thread() will fail. Not only this is a bit strange way to return the error, this is absolutely meaningless. If signal->count > 1 then sighand->count must be also > 1, and unshare_sighand() will fail anyway. In fact, all CLONE_THREAD/SIGHAND/VM checks inside sys_unshare() do not look right. Fortunately this code doesn't really work anyway. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Cc: Balbir Singh <balbir@linux.vnet.ibm.com> Acked-by: Roland McGrath <roland@redhat.com> Cc: Veaceslav Falico <vfalico@redhat.com> Cc: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--kernel/fork.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 7701470ea1b8..40cd099cfc1b 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1518,14 +1518,6 @@ static void check_unshare_flags(unsigned long *flags_ptr)
1518 *flags_ptr |= CLONE_SIGHAND; 1518 *flags_ptr |= CLONE_SIGHAND;
1519 1519
1520 /* 1520 /*
1521 * If unsharing signal handlers and the task was created
1522 * using CLONE_THREAD, then must unshare the thread
1523 */
1524 if ((*flags_ptr & CLONE_SIGHAND) &&
1525 (atomic_read(&current->signal->count) > 1))
1526 *flags_ptr |= CLONE_THREAD;
1527
1528 /*
1529 * If unsharing namespace, must also unshare filesystem information. 1521 * If unsharing namespace, must also unshare filesystem information.
1530 */ 1522 */
1531 if (*flags_ptr & CLONE_NEWNS) 1523 if (*flags_ptr & CLONE_NEWNS)