From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [patch 00/13] vfs: add helpers to check r/o bind mounts Date: Thu, 24 Apr 2008 15:44:48 +0100 Message-ID: <20080424144448.GH15214@ZenIV.linux.org.uk> References: <20080424113950.818688067@szeredi.hu> <20080424124245.GC15214@ZenIV.linux.org.uk> <20080424134826.GD15214@ZenIV.linux.org.uk> <20080424142857.GF15214@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: akpm@linux-foundation.org, torvalds@linux-foundation.org, dave@linux.vnet.ibm.com, ezk@cs.sunysb.edu, mhalcrow@us.ibm.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: Miklos Szeredi Return-path: Received: from zeniv.linux.org.uk ([195.92.253.2]:58634 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752617AbYDXOox (ORCPT ); Thu, 24 Apr 2008 10:44:53 -0400 Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Apr 24, 2008 at 04:36:38PM +0200, Miklos Szeredi wrote: > > RTFS. permission() doesn't do "is that vfsmount read-only" checks, exactly > > because it's 100% bogus - either you cover it with entire area where we > > are guaranteed to stay r/w, or it's by definition racy. > > I know that. > > That does not mean, that fh_verify() needs to do vfsmount r/o checks. > AFAICS it's perfectly OK to do that later, around the vfs_ call. ... and around everything else that happens to be done after fh_verify for write access, surely? Note that e.g. nfsd_setattr() does _not_ call vfs_()... BTW, that assumes we want to do these checks for nfsd at access time. And not go for _exports_ being r/w or r/o, with protection applying to the entire lifetime of export.