Author: pho
Date: Sat Nov 26 20:12:05 2011
New Revision: 228006
URL: http://svn.freebsd.org/changeset/base/228006

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

Modified:
  stable/8/sys/kern/kern_thr.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/kern/kern_thr.c
==============================================================================
--- stable/8/sys/kern/kern_thr.c        Sat Nov 26 18:47:09 2011        
(r228005)
+++ stable/8/sys/kern/kern_thr.c        Sat Nov 26 20:12:05 2011        
(r228006)
@@ -445,7 +445,8 @@ kern_thr_suspend(struct thread *td, stru
        int error = 0, hz = 0;
 
        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)
                        return (ETIMEDOUT);
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to