Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Jan 2009 15:13:47 +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-6@freebsd.org
Subject:   svn commit: r186954 - in stable/6/sys: . kern
Message-ID:  <200901091513.n09FDluo060241@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pho
Date: Fri Jan  9 15:13:46 2009
New Revision: 186954
URL: http://svn.freebsd.org/changeset/base/186954

Log:
  MFC r186510:
  Prevent overflow of uio_resid.
  
  Approved by:	kib

Modified:
  stable/6/sys/   (props changed)
  stable/6/sys/kern/vfs_syscalls.c

Modified: stable/6/sys/kern/vfs_syscalls.c
==============================================================================
--- stable/6/sys/kern/vfs_syscalls.c	Fri Jan  9 14:41:36 2009	(r186953)
+++ stable/6/sys/kern/vfs_syscalls.c	Fri Jan  9 15:13:46 2009	(r186954)
@@ -3697,6 +3697,8 @@ getdirentries(td, uap)
 	int error, eofflag;
 
 	AUDIT_ARG(fd, uap->fd);
+	if (uap->count > INT_MAX)
+		return (EINVAL);
 	if ((error = getvnode(td->td_proc->p_fd, uap->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?200901091513.n09FDluo060241>