From: Sam Vilain <sam@vilain.net>
To: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: Herbert Poetzl <herbert@13thfloor.at>,
Andrew Morton <akpm@osdl.org>,
Christoph Hellwig <hch@infradead.org>,
Al Viro <viro@ftp.linux.org.uk>,
Linux Kernel ML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] vfs: cleanup of permission()
Date: Thu, 02 Mar 2006 11:11:27 +1300 [thread overview]
Message-ID: <44061C0F.2090806@vilain.net> (raw)
In-Reply-To: <1141202744.11585.20.camel@lade.trondhjem.org>
Trond Myklebust wrote:
>>after thinking some time about the oracle words
>>(sent in reply to previous BME submissions) we
>>(Sam and I) came to the conclusion that it would
>>be a good idea to remove the nameidata introduced
>>in September 2003 from the inode permission()
>>checks, so that vfs_permission() can take care
>>of them ...
> Why? There may be perfectly legitimate reasons for the filesystem to
> request information about the path.
Part of what we're trying to achieve is clearly seperating VFS from FS
operations. A lot of the problems with supporting the per-vfsmnt
options stemmed from this confusion.
In fact this was largely developed from your feedback on the prior
thread¹ :) we audited the uses, and you were right - some places really
couldn't set that field properly. After some playing and discussion, we
came to guess that this kind of cleanup was a good way to satisfy your
concerns as well as Christoph's².
¹ http://xrl.us/j9et
² http://xrl.us/j9eo
The only place that the nameidata structure is currently used is in
those two places, and given that it *does* appear to represent FS vs VFS
brain damage to some extent, it's quite important we get this right
before umpteen security modules spring up using this bad hook ... the
API is broken (doesn't cover (struct file*)-based operations, only
lookup (struct nameidata*), and parameter is optional).
> I can think of server failover
> situations in NFSv4 where the client may need to look up the filehandle
> for the file on the new server before it can service the ACCESS call.
The current code doesn't seem to use that right now, at least not via
permission(). Either way, the information should be available - it just
needs to hook in somewhere else.
> Firstly, the fact that the lookup intent flags happen not to collide
> with MAY_* is a complete fluke, not a design. The numerical values of
> either set of flags could change tomorrow for all you know.
> Secondly, an intent is _not_ a permissions mask by any stretch of the
> imagination.
Yeah, I had this in there at one point as a safety check;
#if (_LOOKUP_MASK ^ _ACCESS_MASK) != (_LOOKUP_MASK | _ACCESS_MASK)
#error splode
#endif
You are right, it should either be converted to two parameters or the
combination made more formal.
> IOW: at the very least make that intent flag a separate parameter.
Yes, or rename it mask_and_intent perhaps if they were to be combined in
the same word (which makes sense, with a grand total of 7 bits being
used, and gcc not being in a position to spot that and optimise for us).
>
> Cheers,
> Trond
Thanks for your feedback!
Sam.
prev parent reply other threads:[~2006-03-01 22:11 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-28 5:26 Herbert Poetzl
2006-02-28 5:29 ` [RFC 1/2] vfs: remove nameidata from *_permission() Herbert Poetzl
2006-02-28 5:30 ` [RFC 2/2] vfs: fixup nfs and fuse by passing nd_flags via mask Herbert Poetzl
2006-03-01 8:45 ` [RFC] vfs: cleanup of permission() Trond Myklebust
2006-03-01 12:28 ` tvrtko.ursulin
2006-03-01 12:37 ` Arjan van de Ven
2006-03-01 12:59 ` tvrtko.ursulin
2006-03-01 21:20 ` Sam Vilain
2006-03-01 13:06 ` Herbert Poetzl
2006-03-01 21:18 ` Sam Vilain
2006-03-01 13:11 ` Herbert Poetzl
2006-03-01 23:42 ` Trond Myklebust
2006-03-02 1:35 ` Sam Vilain
2006-03-02 2:26 ` Trond Myklebust
2006-03-01 22:11 ` Sam Vilain [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44061C0F.2090806@vilain.net \
--to=sam@vilain.net \
--cc=akpm@osdl.org \
--cc=hch@infradead.org \
--cc=herbert@13thfloor.at \
--cc=linux-kernel@vger.kernel.org \
--cc=trond.myklebust@fys.uio.no \
--cc=viro@ftp.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome