svn commit: r227674 - head/sys/kern

Peter Holm pho at FreeBSD.org
Fri Nov 18 19:14:43 UTC 2011


Author: pho
Date: Fri Nov 18 19:14:42 2011
New Revision: 227674
URL: http://svn.freebsd.org/changeset/base/227674

Log:
  Added check for negative seconds value. Found by syscall() fuzzing.
  
  MFC after:	1 week

Modified:
  head/sys/kern/kern_thr.c

Modified: head/sys/kern/kern_thr.c
==============================================================================
--- head/sys/kern/kern_thr.c	Fri Nov 18 19:12:12 2011	(r227673)
+++ head/sys/kern/kern_thr.c	Fri Nov 18 19:14:42 2011	(r227674)
@@ -474,7 +474,8 @@ kern_thr_suspend(struct thread *td, stru
 	}
 
 	if (tsp != NULL) {
-		if (tsp->tv_nsec < 0 || tsp->tv_nsec > 1000000000)
+		if (tsp->tv_sec < 0 || tsp->tv_nsec < 0 ||
+		    tsp->tv_nsec > 1000000000)
 			return (EINVAL);
 		if (tsp->tv_sec == 0 && tsp->tv_nsec == 0)
 			error = EWOULDBLOCK;


More information about the svn-src-head mailing list