svn commit: r256032 - head/sys/kern

Sean Bruno sbruno at FreeBSD.org
Thu Oct 3 22:52:04 UTC 2013


Author: sbruno
Date: Thu Oct  3 22:52:03 2013
New Revision: 256032
URL: http://svnweb.freebsd.org/changeset/base/256032

Log:
  Change len checks for fstypelen and fspathlen to be against absolute len
  not strlen as they are *not* strings.
  
  Discovered by GSOC student, Mike Ma <mikemandarine at gmail.com> during his
  fuse.glusterfs port to FreeBSD.
  
  Final patch from mckusick@
  
  Submitted by:	mckusick@
  Approved by:	re (hrs)
  MFC after:	2 weeks

Modified:
  head/sys/kern/vfs_mount.c

Modified: head/sys/kern/vfs_mount.c
==============================================================================
--- head/sys/kern/vfs_mount.c	Thu Oct  3 21:46:43 2013	(r256031)
+++ head/sys/kern/vfs_mount.c	Thu Oct  3 22:52:03 2013	(r256032)
@@ -656,7 +656,7 @@ vfs_donmount(struct thread *td, uint64_t
 	 * variables will fit in our mp buffers, including the
 	 * terminating NUL.
 	 */
-	if (fstypelen >= MFSNAMELEN - 1 || fspathlen >= MNAMELEN - 1) {
+	if (fstypelen > MFSNAMELEN || fspathlen > MNAMELEN) {
 		error = ENAMETOOLONG;
 		goto bail;
 	}


More information about the svn-src-head mailing list