posix-timers: Zero out oldval itimerspec
authorThomas Gleixner <tglx@linutronix.de>
Mon, 12 Jun 2017 17:44:09 +0000 (19:44 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 12 Jun 2017 19:07:40 +0000 (21:07 +0200)
commit5c7a3a3d20a4e175304c0e23809e3d70be8fed8a
tree1787d47a161f70947dd6865ae4527054f46895bc
parentc6503be587e9c5c0aac4e2b45de982352f676a5b
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: eabdec043853 ("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
kernel/time/posix-timers.c