]> git.baikalelectronics.ru Git - kernel.git/commit
ovl: do not require mounter to have MAY_WRITE on lower
authorVivek Goyal <vgoyal@redhat.com>
Fri, 1 Jul 2016 20:34:29 +0000 (16:34 -0400)
committerMiklos Szeredi <mszeredi@redhat.com>
Fri, 29 Jul 2016 10:05:23 +0000 (12:05 +0200)
commit26d2db8e6f8b3bf5edecb331ddad2dd0fea593d6
tree307370378a607f2882df396417aaebed1ef1f590
parent4826d5c968b8152fa0262aa55e7534e0481e57a6
ovl: do not require mounter to have MAY_WRITE on lower

Now we have two levels of checks in ovl_permission(). overlay inode
is checked with the creds of task while underlying inode is checked
with the creds of mounter.

Looks like mounter does not have to have WRITE access to files on lower/.
So remove the MAY_WRITE from access mask for checks on underlying
lower inode.

This means task should still have the MAY_WRITE permission on lower
inode and mounter is not required to have MAY_WRITE.

It also solves the problem of read only NFS mounts being used as lower.
If __inode_permission(lower_inode, MAY_WRITE) is called on read only
NFS, it fails. By resetting MAY_WRITE, check succeeds and case of
read only NFS shold work with overlay without having to specify any
special mount options (default permission).

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/overlayfs/inode.c