summaryrefslogtreecommitdiffstats
path: root/kernel/time.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2006-01-09 20:52:29 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-10 08:01:37 -0800
commit718bcceb5ad72a5def2c2fd1fa3ef964be32a857 (patch)
treea38a49d1af0896acfb00c26f3a9e288071207cc3 /kernel/time.c
parent5f82b2b77e66d452c3037cc47f436d2d76fd5f06 (diff)
downloadlinux-718bcceb5ad72a5def2c2fd1fa3ef964be32a857.tar.gz
linux-718bcceb5ad72a5def2c2fd1fa3ef964be32a857.tar.bz2
linux-718bcceb5ad72a5def2c2fd1fa3ef964be32a857.zip
[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>
Diffstat (limited to 'kernel/time.c')
-rw-r--r--kernel/time.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/time.c b/kernel/time.c
index bbc8ca194b59..c689b53297cf 100644
--- a/kernel/time.c
+++ b/kernel/time.c
@@ -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;