Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1322655 > unrolled thread

[PATCH] ovl: copy new uid/gid into overlayfs runtime inode

Started byKonstantin Khlebnikov <koct9i@gmail.com>
First post2016-01-31 14:30 +0100
Last post2016-01-31 14:30 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] ovl: copy new uid/gid into overlayfs runtime inode Konstantin Khlebnikov <koct9i@gmail.com> - 2016-01-31 14:30 +0100

#1322655 — [PATCH] ovl: copy new uid/gid into overlayfs runtime inode

FromKonstantin Khlebnikov <koct9i@gmail.com>
Date2016-01-31 14:30 +0100
Subject[PATCH] ovl: copy new uid/gid into overlayfs runtime inode
Message-ID<qX0eK-3SI-19@gated-at.bofh.it>
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>
---
 fs/overlayfs/inode.c |    2 ++
 1 file changed, 2 insertions(+)

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);

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web