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>
This commit is contained in:
committed by
James Morris
parent
d2e3ee9b29
commit
5bb459bb45
@@ -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;
|
||||
|
Reference in New Issue
Block a user