summaryrefslogtreecommitdiff
path: root/security/selinux/hooks.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2009-07-10 03:48:23 +0200
committerJames Morris <jmorris@namei.org>2009-07-17 09:10:42 +1000
commit5bb459bb45d1ad3c177485dcf0af01580aa31125 (patch)
treefd6d11d424d222b97f56d8b870bdecbacaab8a17 /security/selinux/hooks.c
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/selinux/hooks.c')
-rw-r--r--security/selinux/hooks.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 2081055f678..e65677da36b 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -5187,7 +5187,7 @@ static int selinux_setprocattr(struct task_struct *p,
/* Only allow single threaded processes to change context */
error = -EPERM;
- if (!is_single_threaded(p)) {
+ if (!current_is_single_threaded()) {
error = security_bounded_transition(tsec->sid, sid);
if (error)
goto abort_change;