mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 15:18:19 +00:00
posix-timers: Correct sanity check in posix_cpu_nsleep
CPUCLOCK_PID(which_clock) is a pid value from userspace so compare it against task_pid_vnr, not current->pid. As task_pid_vnr is in the tasks pid value in the tasks pid namespace, and current->pid is in the initial pid namespace. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
This commit is contained in:
parent
b54807fa52
commit
01a2197485
1 changed files with 1 additions and 1 deletions
|
@ -1312,7 +1312,7 @@ static int posix_cpu_nsleep(const clockid_t which_clock, int flags,
|
||||||
*/
|
*/
|
||||||
if (CPUCLOCK_PERTHREAD(which_clock) &&
|
if (CPUCLOCK_PERTHREAD(which_clock) &&
|
||||||
(CPUCLOCK_PID(which_clock) == 0 ||
|
(CPUCLOCK_PID(which_clock) == 0 ||
|
||||||
CPUCLOCK_PID(which_clock) == current->pid))
|
CPUCLOCK_PID(which_clock) == task_pid_vnr(current)))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
error = do_cpu_nanosleep(which_clock, flags, rqtp, &it);
|
error = do_cpu_nanosleep(which_clock, flags, rqtp, &it);
|
||||||
|
|
Loading…
Reference in a new issue