From owner-freebsd-current Thu Feb 15 10:27:51 2001 Delivered-To: freebsd-current@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id D1D0C37B401; Thu, 15 Feb 2001 10:27:48 -0800 (PST) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id f1FIRk427526; Thu, 15 Feb 2001 10:27:46 -0800 (PST) Date: Thu, 15 Feb 2001 10:27:46 -0800 From: Alfred Perlstein To: Martin Blapp Cc: adrian@FreeBSD.ORG, current@FreeBSD.ORG Subject: Re: Fix for mountpath lenght Message-ID: <20010215102746.H3274@fw.wintelcom.net> References: <20010215101512.F3274@fw.wintelcom.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010215101512.F3274@fw.wintelcom.net>; from bright@wintelcom.net on Thu, Feb 15, 2001 at 10:15:12AM -0800 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * Alfred Perlstein [010215 10:15] wrote: > This looks right, except that Bruce says that SCARG isn't to be > used, instead just use uap->path. Also, you can't call strlen on a userland pointer. please test patches before submitting them! > > -Alfred > > * Martin Blapp [010215 09:46] wrote: > > > > In mount.h, we have a #define MNAMELEN 80 > > > > and in struct statfs {} we have: > > > > char f_mntonname[MNAMELEN]; /* directory on which mounted */ > > > > but the kernel does no check to see if the mountpath is longer > > than MNAMELEN, it just accepts it ? It's impossible to umount(8) > > it, because umount(8) does not like to unmount some device which > > does not belong to the mountpoint. > > > > --- vfs_syscalls.c Sun Nov 26 03:30:05 2000 > > +++ vfs_syscalls.c.new Thu Feb 15 18:22:13 2001 > > @@ -140,6 +140,8 @@ > > /* > > * Get vnode to be covered > > */ > > + if (strlen(SCARG(uap, path)) > MNAMELEN) > > + return (ENAMETOOLONG); > > NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, > > SCARG(uap, path), p); > > if ((error = namei(&nd)) != 0) > > > > Martin Blapp, mb@imp.ch > > ------------------------------------------------ > > Improware AG, UNIX solution and service provider > > Zurlindenstrasse 29, 4133 Pratteln, Switzerland > > Phone: +41 79 370 26 05, Fax: +41 61 826 93 01 > > ------------------------------------------------ > > > > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > > with "unsubscribe freebsd-current" in the body of the message > > -- > -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] > "I have the heart of a child; I keep it in a jar on my desk." > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-current" in the body of the message -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] "I have the heart of a child; I keep it in a jar on my desk." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message