Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Oct 2013 22:52:03 +0000 (UTC)
From:      Sean Bruno <sbruno@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r256032 - head/sys/kern
Message-ID:  <201310032252.r93Mq3t4083119@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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@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;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310032252.r93Mq3t4083119>