svn commit: r192001 - head/sys/kern

Konstantin Belousov kib at FreeBSD.org
Mon May 11 19:58:07 UTC 2009


Author: kib
Date: Mon May 11 19:58:03 2009
New Revision: 192001
URL: http://svn.freebsd.org/changeset/base/192001

Log:
  Prevent overflow of uio_resid.
  
  Noted by:	jhb
  MFC after:	3 days

Modified:
  head/sys/kern/vfs_syscalls.c

Modified: head/sys/kern/vfs_syscalls.c
==============================================================================
--- head/sys/kern/vfs_syscalls.c	Mon May 11 19:37:05 2009	(r192000)
+++ head/sys/kern/vfs_syscalls.c	Mon May 11 19:58:03 2009	(r192001)
@@ -2596,6 +2596,9 @@ kern_readlinkat(struct thread *td, int f
 	struct nameidata nd;
 	int vfslocked;
 
+	if (count > INT_MAX)
+		return (EINVAL);
+
 	NDINIT_AT(&nd, LOOKUP, NOFOLLOW | LOCKSHARED | LOCKLEAF | MPSAFE |
 	    AUDITVNODE1, pathseg, path, fd, td);
 


More information about the svn-src-all mailing list