Fix POSIX ACL permission check
authorAri Savolainen <ari.m.savolainen@gmail.com>
Sat, 6 Aug 2011 16:43:07 +0000 (19:43 +0300)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 7 Aug 2011 08:52:23 +0000 (04:52 -0400)
After commit 3567866bf261: "RCUify freeing acls, let check_acl() go ahead in
RCU mode if acl is cached" posix_acl_permission is being called with an
unsupported flag and the permission check fails. This patch fixes the issue.

Signed-off-by: Ari Savolainen <ari.m.savolainen@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namei.c

index 4a98bf154d88421fc3148d96133843a4da01a828..fc13609a354a4d5ae919a1cfb31d1a788d537c68 100644 (file)
@@ -186,7 +186,7 @@ static int check_acl(struct inode *inode, int mask)
                /* no ->get_acl() calls in RCU mode... */
                if (acl == ACL_NOT_CACHED)
                        return -ECHILD;
-               return posix_acl_permission(inode, acl, mask);
+               return posix_acl_permission(inode, acl, mask & ~MAY_NOT_BLOCK);
        }
 
        acl = get_cached_acl(inode, ACL_TYPE_ACCESS);