+ vfs-define-new-lookup-flag-for-chdir.patch added to -mm tree

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

 



The patch titled

     vfs: define new lookup flag for chdir

has been added to the -mm tree.  Its filename is

     vfs-define-new-lookup-flag-for-chdir.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: vfs: define new lookup flag for chdir
From: Miklos Szeredi <miklos@xxxxxxxxxx>

In the "operation does permission checking" model used by fuse, chdir
permission is not checked, since there's no chdir method.

For this case set a lookup flag, which will be passed to ->permission(), so
fuse can distinguish it from permission checks for other operations.

Signed-off-by: Miklos Szeredi <miklos@xxxxxxxxxx>
Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 fs/fuse/dir.c         |    2 +-
 fs/open.c             |    3 ++-
 include/linux/namei.h |    1 +
 3 files changed, 4 insertions(+), 2 deletions(-)

diff -puN fs/fuse/dir.c~vfs-define-new-lookup-flag-for-chdir fs/fuse/dir.c
--- a/fs/fuse/dir.c~vfs-define-new-lookup-flag-for-chdir
+++ a/fs/fuse/dir.c
@@ -776,7 +776,7 @@ static int fuse_permission(struct inode 
 		if ((mask & MAY_EXEC) && !S_ISDIR(mode) && !(mode & S_IXUGO))
 			return -EACCES;
 
-		if (nd && (nd->flags & LOOKUP_ACCESS))
+		if (nd && (nd->flags & (LOOKUP_ACCESS | LOOKUP_CHDIR)))
 			return fuse_access(inode, mask);
 		return 0;
 	}
diff -puN fs/open.c~vfs-define-new-lookup-flag-for-chdir fs/open.c
--- a/fs/open.c~vfs-define-new-lookup-flag-for-chdir
+++ a/fs/open.c
@@ -546,7 +546,8 @@ asmlinkage long sys_chdir(const char __u
 	struct nameidata nd;
 	int error;
 
-	error = __user_walk(filename, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &nd);
+	error = __user_walk(filename,
+			    LOOKUP_FOLLOW|LOOKUP_DIRECTORY|LOOKUP_CHDIR, &nd);
 	if (error)
 		goto out;
 
diff -puN include/linux/namei.h~vfs-define-new-lookup-flag-for-chdir include/linux/namei.h
--- a/include/linux/namei.h~vfs-define-new-lookup-flag-for-chdir
+++ a/include/linux/namei.h
@@ -54,6 +54,7 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LA
 #define LOOKUP_OPEN		(0x0100)
 #define LOOKUP_CREATE		(0x0200)
 #define LOOKUP_ACCESS		(0x0400)
+#define LOOKUP_CHDIR		(0x0800)
 
 extern int FASTCALL(__user_walk(const char __user *, unsigned, struct nameidata *));
 extern int FASTCALL(__user_walk_fd(int dfd, const char __user *, unsigned, struct nameidata *));
_

Patches currently in -mm which might be from miklos@xxxxxxxxxx are

add-address_space_operationsbatch_write.patch
add-address_space_operationsbatch_write-fix.patch
pass-io-size-to-batch_write-address-space-operation.patch
fuse-add-lock-annotations-to-request_end-and-fuse_read_interrupt.patch
fuse-fix-zero-timeout.patch
fuse-use-jiffies_64.patch
fuse-fix-typo.patch
fuse-use-dentry-in-statfs.patch
vfs-define-new-lookup-flag-for-chdir.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux