diff options
author | Konstantin Khlebnikov <koct9i@gmail.com> | 2016-01-31 14:21:29 +0100 |
---|---|---|
committer | Miklos Szeredi <miklos@szeredi.hu> | 2016-03-03 17:17:46 +0100 |
commit | b81de061fa59f17d2730aabb1b84419ef3913810 (patch) | |
tree | d861fedc4ab91b88d225fff34f292bd7c465f6d2 /fs/overlayfs | |
parent | ovl: ignore lower entries when checking purity of non-directory entries (diff) | |
download | linux-b81de061fa59f17d2730aabb1b84419ef3913810.tar.xz linux-b81de061fa59f17d2730aabb1b84419ef3913810.zip |
ovl: copy new uid/gid into overlayfs runtime inode
Overlayfs must update uid/gid after chown, otherwise functions
like inode_owner_or_capable() will check user against stale uid.
Catched by xfstests generic/087, it chowns file and calls utimes.
Signed-off-by: Konstantin Khlebnikov <koct9i@gmail.com>
Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Cc: <stable@vger.kernel.org>
Diffstat (limited to 'fs/overlayfs')
-rw-r--r-- | fs/overlayfs/inode.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c index 49e204560655..a4ff5d0d7db9 100644 --- a/fs/overlayfs/inode.c +++ b/fs/overlayfs/inode.c @@ -65,6 +65,8 @@ int ovl_setattr(struct dentry *dentry, struct iattr *attr) inode_lock(upperdentry->d_inode); err = notify_change(upperdentry, attr, NULL); + if (!err) + ovl_copyattr(upperdentry->d_inode, dentry->d_inode); inode_unlock(upperdentry->d_inode); } ovl_drop_write(dentry); |