Skip to content

Commit

Permalink
[PATCH] hrtimer: validate timespec of do_sys_settimeofday
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thomas Gleixner authored and Linus Torvalds committed Jan 10, 2006
1 parent 5f82b2b commit 718bcce
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 718bcce

Please sign in to comment.