diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2017-04-13 10:32:16 -0500 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2017-04-16 23:42:50 -0500 |
commit | 01a2197485a9917216ad67ced4bafed9f7942f5a (patch) | |
tree | 25956afbd5dbb1f49936d6c38ddd113b6754b33d /kernel | |
parent | b54807fa52ae21bdf6bad72b0f00fd400af412eb (diff) | |
download | linux-stable-01a2197485a9917216ad67ced4bafed9f7942f5a.tar.gz linux-stable-01a2197485a9917216ad67ced4bafed9f7942f5a.tar.bz2 linux-stable-01a2197485a9917216ad67ced4bafed9f7942f5a.zip |
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>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/time/posix-cpu-timers.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c index 4513ad16a253..37f9bb8c193e 100644 --- a/kernel/time/posix-cpu-timers.c +++ b/kernel/time/posix-cpu-timers.c @@ -1312,7 +1312,7 @@ static int posix_cpu_nsleep(const clockid_t which_clock, int flags, */ if (CPUCLOCK_PERTHREAD(which_clock) && (CPUCLOCK_PID(which_clock) == 0 || - CPUCLOCK_PID(which_clock) == current->pid)) + CPUCLOCK_PID(which_clock) == task_pid_vnr(current))) return -EINVAL; error = do_cpu_nanosleep(which_clock, flags, rqtp, &it); |