Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Nov 2011 20:12:05 +0000 (UTC)
From:      Peter Holm <pho@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r228006 - stable/8/sys/kern
Message-ID:  <201111262012.pAQKC5aY006850@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201111262012.pAQKC5aY006850>