[patch 12/21] Validate timespec of do_sys_settimeofday

From: tglx
Date: Mon Dec 05 2005 - 19:35:42 EST



- Check if the timespec which is provided from user space is
normalized.

Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxx>

kernel/time.c | 3 +++
1 files changed, 3 insertions(+)

Index: linux-2.6.15-rc5/kernel/time.c
===================================================================
--- linux-2.6.15-rc5.orig/kernel/time.c
+++ linux-2.6.15-rc5/kernel/time.c
@@ -154,6 +154,9 @@ int do_sys_settimeofday(struct timespec
static int firsttime = 1;
int error = 0;

+ if (!timespec_valid(tv))
+ return -EINVAL;
+
error = security_settime(tv, tz);
if (error)
return error;

--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/