From owner-svn-src-head@FreeBSD.ORG Sat Dec 27 10:13:44 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F69A106567C; Sat, 27 Dec 2008 10:13:44 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3DA378FC24; Sat, 27 Dec 2008 10:13:44 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBRADi6j067033; Sat, 27 Dec 2008 10:13:44 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBRADiob067032; Sat, 27 Dec 2008 10:13:44 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <200812271013.mBRADiob067032@svn.freebsd.org> From: Peter Holm Date: Sat, 27 Dec 2008 10:13:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186510 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Dec 2008 10:13:44 -0000 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) {