Commit dd98acf74762764fbc4382a1d9a244f11a2658cc

Authored by Oleg Nesterov
Committed by Linus Torvalds
1 parent 5089a97680

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.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: David Howells <dhowells@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Acked-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

security/keys/keyctl.c
... ... @@ -1269,7 +1269,7 @@
1269 1269 goto not_permitted;
1270 1270  
1271 1271 /* the parent must be single threaded */
1272   - if (atomic_read(&parent->signal->count) != 1)
  1272 + if (!thread_group_empty(parent))
1273 1273 goto not_permitted;
1274 1274  
1275 1275 /* the parent and the child must have different session keyrings or