summaryrefslogtreecommitdiff
path: root/kernel/time/time.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2015-01-22 12:26:41 +0100
committerThomas Gleixner <tglx@linutronix.de>2015-01-22 12:28:02 +0100
commit5fbaba8603d5bbc9e40bcb970bae64cb7e093755 (patch)
treebcffaa86c7be757ab4c34283d9b6ec8643101dd9 /kernel/time/time.c
parentf2a5473861cf69c03d0f0ee5d0ea1b853b9e582e (diff)
parent5e5aeb4367b450a28f447f6d5ab57d8f2ab16a5f (diff)
Merge branch 'fortglx/3.19-stable/time' of https://git.linaro.org/people/john.stultz/linux into timers/urgent
Pull urgent fixes from John Stultz: Two urgent fixes for user triggerable time related overflow issues
Diffstat (limited to 'kernel/time/time.c')
-rw-r--r--kernel/time/time.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/time/time.c b/kernel/time/time.c
index 65015ff2f07c..887e7d505974 100644
--- a/kernel/time/time.c
+++ b/kernel/time/time.c
@@ -196,6 +196,10 @@ SYSCALL_DEFINE2(settimeofday, struct timeval __user *, tv,
if (tv) {
if (copy_from_user(&user_tv, tv, sizeof(*tv)))
return -EFAULT;
+
+ if (!timeval_valid(&user_tv))
+ return -EINVAL;
+
new_ts.tv_sec = user_tv.tv_sec;
new_ts.tv_nsec = user_tv.tv_usec * NSEC_PER_USEC;
}