Re: [PATCH] VFS: Suppress automount on [l]stat, [l]getxattr, etc.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 26, 2011 at 3:33 PM, Trond Myklebust
<Trond.Myklebust@xxxxxxxxxx> wrote:
>
> Lookup permission checks would be replaced with open permission checks
> on the server.
>
> IOW: the operation could potentially fail due to a completely unrelated
> issue.

Quite frankly, that still sounds like a "I'm trying to make a problem
out of something that isn't actually a problem". And you still seem to
be unwilling to admit that LOOKUP_FOLLOW is a problem that has
actually been reported in real life, so you just cut out that part of
my question about how this would be a bigger issue.

But whatever. I can't really care, since it's a two-liner to add a new
flag, and then it falls down to "if you want to follow automounts, you
can set that flag instead".

Almost nobody is ever going to bother setting the flag anyway, since
LOOKUP_OPEN and LOOKUP_DIRECTORY are going to take care of all the
common cases.

So here. You can set LOOKUP_AUTOMOUNT to force an automount traversal. Ok?

                       Linus
 fs/namei.c            |    2 +-
 include/linux/namei.h |    1 +
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/fs/namei.c b/fs/namei.c
index f4788365ea22..09606fd83d57 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -739,7 +739,7 @@ static int follow_automount(struct path *path, unsigned flags,
 	 * of the daemon to instantiate them before they can be used.
 	 */
 	if (!(flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY |
-		     LOOKUP_OPEN | LOOKUP_CREATE)) &&
+		     LOOKUP_OPEN | LOOKUP_CREATE | LOOKUP_AUTOMOUNT)) &&
 	    path->dentry->d_inode)
 		return -EISDIR;
 
diff --git a/include/linux/namei.h b/include/linux/namei.h
index 76fe2c62ae71..e13dac7caab2 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -48,6 +48,7 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND};
  */
 #define LOOKUP_FOLLOW		0x0001
 #define LOOKUP_DIRECTORY	0x0002
+#define LOOKUP_AUTOMOUNT	0x0004
 
 #define LOOKUP_PARENT		0x0010
 #define LOOKUP_REVAL		0x0020

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux