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;
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to