All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] check_unshare_flags: kill the bogus CLONE_SIGHAND/sig->count check
@ 2010-03-21 18:48 Oleg Nesterov
  2010-04-09 19:41 ` Roland McGrath
  0 siblings, 1 reply; 2+ messages in thread
From: Oleg Nesterov @ 2010-03-21 18:48 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Janak Desai, Roland McGrath, linux-kernel

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>
---

 kernel/fork.c |    8 --------
 1 file changed, 8 deletions(-)

--- 34-rc1/kernel/fork.c~UNSHARE_DONT_USE_SIG_COUNT	2010-03-21 18:37:31.000000000 +0100
+++ 34-rc1/kernel/fork.c	2010-03-21 19:08:06.000000000 +0100
@@ -1519,14 +1519,6 @@ static void check_unshare_flags(unsigned
 		*flags_ptr |= CLONE_SIGHAND;
 
 	/*
-	 * If unsharing signal handlers and the task was created
-	 * using CLONE_THREAD, then must unshare the thread
-	 */
-	if ((*flags_ptr & CLONE_SIGHAND) &&
-	    (atomic_read(&current->signal->count) > 1))
-		*flags_ptr |= CLONE_THREAD;
-
-	/*
 	 * If unsharing namespace, must also unshare filesystem information.
 	 */
 	if (*flags_ptr & CLONE_NEWNS)


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

* Re: [PATCH] check_unshare_flags: kill the bogus CLONE_SIGHAND/sig->count check
  2010-03-21 18:48 [PATCH] check_unshare_flags: kill the bogus CLONE_SIGHAND/sig->count check Oleg Nesterov
@ 2010-04-09 19:41 ` Roland McGrath
  0 siblings, 0 replies; 2+ messages in thread
From: Roland McGrath @ 2010-04-09 19:41 UTC (permalink / raw)
  To: Oleg Nesterov; +Cc: Andrew Morton, Janak Desai, linux-kernel

Acked-by: Roland McGrath <roland@redhat.com>


Thanks,
Roland

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

end of thread, other threads:[~2010-04-09 19:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-21 18:48 [PATCH] check_unshare_flags: kill the bogus CLONE_SIGHAND/sig->count check Oleg Nesterov
2010-04-09 19:41 ` Roland McGrath

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.