Browse Source

[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>
Thomas Gleixner 19 năm trước cách đây
mục cha
commit
718bcceb5a
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      kernel/time.c

+ 3 - 0
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;