aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2009-07-09 21:48:23 -0400
committerJames Morris <jmorris@namei.org>2009-07-16 19:10:42 -0400
commit5bb459bb45d1ad3c177485dcf0af01580aa31125 (patch)
treefd6d11d424d222b97f56d8b870bdecbacaab8a17 /security
parentd2e3ee9b29f5de5b01e611b04e6fb29760589b01 (diff)
kernel: rename is_single_threaded(task) to current_is_single_threaded(void)
- is_single_threaded(task) is not safe unless task == current, we can't use task->signal or task->mm. - it doesn't make sense unless task == current, the task can fork right after the check. Rename it to current_is_single_threaded() and kill the argument. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Acked-by: David Howells <dhowells@redhat.com> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security')
-rw-r--r--security/keys/process_keys.c2
-rw-r--r--security/selinux/hooks.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/security/keys/process_keys.c b/security/keys/process_keys.c
index 276d27882ce8..ed929af466d3 100644
--- a/security/keys/process_keys.c
+++ b/security/keys/process_keys.c
@@ -702,7 +702,7 @@ long join_session_keyring(const char *name)
702 /* only permit this if there's a single thread in the thread group - 702 /* only permit this if there's a single thread in the thread group -
703 * this avoids us having to adjust the creds on all threads and risking 703 * this avoids us having to adjust the creds on all threads and risking
704 * ENOMEM */ 704 * ENOMEM */
705 if (!is_single_threaded(current)) 705 if (!current_is_single_threaded())
706 return -EMLINK; 706 return -EMLINK;
707 707
708 new = prepare_creds(); 708 new = prepare_creds();
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 2081055f6783..e65677da36bd 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -5187,7 +5187,7 @@ static int selinux_setprocattr(struct task_struct *p,
5187 5187
5188 /* Only allow single threaded processes to change context */ 5188 /* Only allow single threaded processes to change context */
5189 error = -EPERM; 5189 error = -EPERM;
5190 if (!is_single_threaded(p)) { 5190 if (!current_is_single_threaded()) {
5191 error = security_bounded_transition(tsec->sid, sid); 5191 error = security_bounded_transition(tsec->sid, sid);
5192 if (error) 5192 if (error)
5193 goto abort_change; 5193 goto abort_change;