From owner-svn-src-head@FreeBSD.ORG Thu Oct 3 22:52:04 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 38DA538A; Thu, 3 Oct 2013 22:52:04 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 25618250E; Thu, 3 Oct 2013 22:52:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r93Mq3tX083120; Thu, 3 Oct 2013 22:52:03 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r93Mq3t4083119; Thu, 3 Oct 2013 22:52:03 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201310032252.r93Mq3t4083119@svn.freebsd.org> From: Sean Bruno Date: Thu, 3 Oct 2013 22:52:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256032 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 03 Oct 2013 22:52:04 -0000 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 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; }