projects/linux·commit 718bcceb

[PATCH] hrtimer: validate timespec of do_sys_settimeofday

718bcceb · Thomas Gleixner <[email protected]> · 2006-01-09 20:52:29 -08:00

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

Signed-off-by: Thomas Gleixner <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
718bcceb5ad72a5def2c2fd1fa3ef964be32a857
Parents
5f82b2b7

Changes

1 files changed · +3 −0

FileStatusAddDelContent
kernel/time.cmodified+3−0View file

kernel/time.c

View file
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 @@ 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;