time: settimeofday: Validate the values of tv from user
authorSasha Levin <sasha.levin@oracle.com>
Thu, 4 Dec 2014 00:22:48 +0000 (19:22 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 30 Jan 2015 01:40:49 +0000 (17:40 -0800)
commit5fea291eddb2b2721874c860783e0516df3ad699
treecb0d7d2a7b1528d6d7349a7cf98404514627bb1f
parentba42a61e500b1619c4f29cd2b6ac693c0ecc9645
time: settimeofday: Validate the values of tv from user

commit 6ada1fc0e1c4775de0e043e1bd3ae9d065491aa5 upstream.

An unvalidated user input is multiplied by a constant, which can result in
an undefined behaviour for large values. While this is validated later,
we should avoid triggering undefined behaviour.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
[jstultz: include trivial milisecond->microsecond correction noticed
by Andy]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/time.h
kernel/time.c