svn commit: r186510 - head/sys/kern

Peter Holm pho at FreeBSD.org
Sat Dec 27 10:13:44 UTC 2008


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) {


More information about the svn-src-head mailing list