Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Dec 2008 10:13:44 +0000 (UTC)
From:      Peter Holm <pho@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r186510 - head/sys/kern
Message-ID:  <200812271013.mBRADiob067032@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pho
Date: Sat Dec 27 10:13:43 2008
New Revision: 186510
URL: http://svn.freebsd.org/changeset/base/186510

Log:
  Prevent overflow of uio_resid.
  
  Approved by:	kib

Modified:
  head/sys/kern/vfs_syscalls.c

Modified: head/sys/kern/vfs_syscalls.c
==============================================================================
--- head/sys/kern/vfs_syscalls.c	Sat Dec 27 09:42:17 2008	(r186509)
+++ head/sys/kern/vfs_syscalls.c	Sat Dec 27 10:13:43 2008	(r186510)
@@ -4069,6 +4069,8 @@ kern_getdirentries(struct thread *td, in
 	int error, eofflag;
 
 	AUDIT_ARG(fd, fd);
+	if (count > INT_MAX)
+		return (EINVAL);
 	if ((error = getvnode(td->td_proc->p_fd, fd, &fp)) != 0)
 		return (error);
 	if ((fp->f_flag & FREAD) == 0) {



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