mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 20:22:09 +00:00
[PATCH] revert "Drop tasklist lock in do_sched_setscheduler"
sched_setscheduler() looks at ->signal->rlim[]. It is unsafe do dereference ->signal unless tasklist_lock or ->siglock is held (or p == current). We pin the task structure, but this can't prevent from release_task()->__exit_signal() which sets ->signal = NULL. Restore tasklist_lock across the setscheduler call. Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Cc: Greg KH <greg@kroah.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
cb3e0fe3a5
commit
f8986c241d
@ -4162,10 +4162,8 @@ do_sched_setscheduler(pid_t pid, int policy, struct sched_param __user *param)
|
||||
read_unlock_irq(&tasklist_lock);
|
||||
return -ESRCH;
|
||||
}
|
||||
get_task_struct(p);
|
||||
read_unlock_irq(&tasklist_lock);
|
||||
retval = sched_setscheduler(p, policy, &lparam);
|
||||
put_task_struct(p);
|
||||
read_unlock_irq(&tasklist_lock);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user