Skip to content

Commit

Permalink
keyctl_session_to_parent(): use thread_group_empty() to check singlet…
Browse files Browse the repository at this point in the history
…hreadness

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 <[email protected]>
Acked-by: David Howells <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Acked-by: Roland McGrath <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
oleg-nesterov authored and torvalds committed May 27, 2010
1 parent 5089a97 commit dd98acf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion security/keys/keyctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dd98acf

Please sign in to comment.