All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -mm 2/2] keyctl_session_to_parent: use thread_group_empty() to check singlethreadness
@ 2010-03-23 14:48 Oleg Nesterov
  2010-03-24  8:56 ` David Howells
  2010-04-09 19:45 ` Roland McGrath
  0 siblings, 2 replies; 3+ messages in thread
From: Oleg Nesterov @ 2010-03-23 14:48 UTC (permalink / raw)
  To: Andrew Morton; +Cc: David Howells, Peter Zijlstra, Roland McGrath, linux-kernel

No functional changes.

keyctl_session_to_parent() is the only user of signal->count which needs
the correct value. Change it to use thread_group_empty() instead, this
must be strictly equivalent under tasklist, and imho looks better.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
---

 security/keys/keyctl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 34-rc1/security/keys/keyctl.c~MISC_2_KEYCTL	2009-12-18 19:05:38.000000000 +0100
+++ 34-rc1/security/keys/keyctl.c	2010-03-23 15:21:00.000000000 +0100
@@ -1269,7 +1269,7 @@ long keyctl_session_to_parent(void)
 		goto not_permitted;
 
 	/* the parent must be single threaded */
-	if (atomic_read(&parent->signal->count) != 1)
+	if (!thread_group_empty(parent))
 		goto not_permitted;
 
 	/* the parent and the child must have different session keyrings or


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

* Re: [PATCH -mm 2/2] keyctl_session_to_parent: use thread_group_empty() to check singlethreadness
  2010-03-23 14:48 [PATCH -mm 2/2] keyctl_session_to_parent: use thread_group_empty() to check singlethreadness Oleg Nesterov
@ 2010-03-24  8:56 ` David Howells
  2010-04-09 19:45 ` Roland McGrath
  1 sibling, 0 replies; 3+ messages in thread
From: David Howells @ 2010-03-24  8:56 UTC (permalink / raw)
  To: Oleg Nesterov
  Cc: dhowells, Andrew Morton, Peter Zijlstra, Roland McGrath, linux-kernel

Oleg Nesterov <oleg@redhat.com> wrote:

> No functional changes.
> 
> keyctl_session_to_parent() is the only user of signal->count which needs
> the correct value. Change it to use thread_group_empty() instead, this
> must be strictly equivalent under tasklist, and imho looks better.
> 
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>

Acked-by: David Howells <dhowells@redhat.com>

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

* Re: [PATCH -mm 2/2] keyctl_session_to_parent: use thread_group_empty() to check singlethreadness
  2010-03-23 14:48 [PATCH -mm 2/2] keyctl_session_to_parent: use thread_group_empty() to check singlethreadness Oleg Nesterov
  2010-03-24  8:56 ` David Howells
@ 2010-04-09 19:45 ` Roland McGrath
  1 sibling, 0 replies; 3+ messages in thread
From: Roland McGrath @ 2010-04-09 19:45 UTC (permalink / raw)
  To: Oleg Nesterov; +Cc: Andrew Morton, David Howells, Peter Zijlstra, linux-kernel

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


Thanks,
Roland

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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-23 14:48 [PATCH -mm 2/2] keyctl_session_to_parent: use thread_group_empty() to check singlethreadness Oleg Nesterov
2010-03-24  8:56 ` David Howells
2010-04-09 19:45 ` 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.