[PATCH] hrtimer: validate timespec of do_sys_settimeofday
Check if the timespec which is provided from user space is normalized.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
diff --git a/kernel/time.c b/kernel/time.c
index bbc8ca1..c689b53 100644
--- a/kernel/time.c
+++ b/kernel/time.c
@@ -154,6 +154,9 @@
static int firsttime = 1;
int error = 0;
+ if (!timespec_valid(tv))
+ return -EINVAL;
+
error = security_settime(tv, tz);
if (error)
return error;