mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-04 01:49:36 +00:00
posix-timers: Zero out oldval itimerspec
The recent posix timer rework moved the clearing of the itimerspec to the
real syscall implementation, but forgot that the kclock->timer_get() is
used by timer_settime() as well. That results in an uninitialized variable
and bogus values returned to user space.
Add the missing memset to timer_settime().
Fixes: eabdec0438
("posix-timers: Zero settings value in common code")
Reported-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Link: http://lkml.kernel.org/r/20170609201156.GB21491@outlook.office365.com
This commit is contained in:
parent
c6503be587
commit
5c7a3a3d20
1 changed files with 2 additions and 0 deletions
|
@ -828,6 +828,8 @@ SYSCALL_DEFINE4(timer_settime, timer_t, timer_id, int, flags,
|
|||
if (!timespec64_valid(&new_spec64.it_interval) ||
|
||||
!timespec64_valid(&new_spec64.it_value))
|
||||
return -EINVAL;
|
||||
if (rtn)
|
||||
memset(rtn, 0, sizeof(*rtn));
|
||||
retry:
|
||||
timr = lock_timer(timer_id, &flag);
|
||||
if (!timr)
|
||||
|
|
Loading…
Reference in a new issue