keyctl_session_to_parent: use thread_group_empty() to check singlethreadness
Subsystems (2)
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.
Signed-off-by Oleg Nesterov <[email protected]>
---
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
Quoted 7 lines · Oleg Nesterov
No functional changes.
keyctl_session_to_parent()is the only user ofsignal->countwhich needs the correct value. Change it to usethread_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]>
Acked-by Roland McGrath <[email protected]>
Thanks,
Roland