svn commit: r230008 - stable/9/sys/kern

Peter Holm pho at FreeBSD.org
Thu Jan 12 08:03:27 UTC 2012


Author: pho
Date: Thu Jan 12 08:03:26 2012
New Revision: 230008
URL: http://svn.freebsd.org/changeset/base/230008

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

Modified:
  stable/9/sys/kern/kern_thr.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/kern_thr.c
==============================================================================
--- stable/9/sys/kern/kern_thr.c	Thu Jan 12 06:48:11 2012	(r230007)
+++ stable/9/sys/kern/kern_thr.c	Thu Jan 12 08:03:26 2012	(r230008)
@@ -473,7 +473,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-all mailing list