From: Thomas Gleixner Date: Tue, 10 Jan 2006 04:52:29 +0000 (-0800) Subject: [PATCH] hrtimer: validate timespec of do_sys_settimeofday X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=718bcceb5ad72a5def2c2fd1fa3ef964be32a857;p=openwrt%2Fstaging%2Fblogic.git [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 Signed-off-by: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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;