Skip to contentSkip to conversation

keyctl_session_to_parent: use thread_group_empty() to check singlethreadness

PATCH In review Oleg Nesterov 3 participants 3 messages Mar 23, 2010 – Apr 9, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 keyctl_session_to_parent: use thread_group_empty() to check singlethreadness

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.

---

 security/keys/keyctl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
security/keys/keyctl.c renamed from security/keys/keyctl.c~MISC_2_KEYCTL +1 -1
@@ -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