]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] hrtimer: validate timespec of do_sys_settimeofday
authorThomas Gleixner <tglx@linutronix.de>
Tue, 10 Jan 2006 04:52:29 +0000 (20:52 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 10 Jan 2006 16:01:37 +0000 (08:01 -0800)
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>
kernel/time.c

index bbc8ca194b59ee3687a1ec4ced54a94e4cadbbde..c689b53297cfb0dc3c1b36d04240cebad8766d87 100644 (file)
@@ -154,6 +154,9 @@ int do_sys_settimeofday(struct timespec *tv, struct timezone *tz)
        static int firsttime = 1;
        int error = 0;
 
+       if (!timespec_valid(tv))
+               return -EINVAL;
+
        error = security_settime(tv, tz);
        if (error)
                return error;