diff mbox

[4.2.y-ckt,stable] Patch "ovl: copy new uid/gid into overlayfs runtime inode" has been added to the 4.2.y-ckt tree

Message ID 1458084369-21053-1-git-send-email-kamal@canonical.com
State New
Headers show

Commit Message

Kamal Mostafa March 15, 2016, 11:26 p.m. UTC
This is a note to let you know that I have just added a patch titled

    ovl: copy new uid/gid into overlayfs runtime inode

to the linux-4.2.y-queue branch of the 4.2.y-ckt extended stable tree 
which can be found at:

    http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-4.2.y-queue

This patch is scheduled to be released in version 4.2.8-ckt6.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 4.2.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Kamal

---8<------------------------------------------------------------

From 49370f1bc3bcb47429897ed474a592d2145c1dcd Mon Sep 17 00:00:00 2001
From: Konstantin Khlebnikov <koct9i@gmail.com>
Date: Sun, 31 Jan 2016 16:21:29 +0300
Subject: ovl: copy new uid/gid into overlayfs runtime inode

commit b81de061fa59f17d2730aabb1b84419ef3913810 upstream.

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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 fs/overlayfs/inode.c | 2 ++
 1 file changed, 2 insertions(+)

--
2.7.0
diff mbox

Patch

diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c
index 34300c2..0d28234 100644
--- a/fs/overlayfs/inode.c
+++ b/fs/overlayfs/inode.c
@@ -68,6 +68,8 @@  int ovl_setattr(struct dentry *dentry, struct iattr *attr)

 		mutex_lock(&upperdentry->d_inode->i_mutex);
 		err = notify_change(upperdentry, attr, NULL);
+		if (!err)
+			ovl_copyattr(upperdentry->d_inode, dentry->d_inode);
 		mutex_unlock(&upperdentry->d_inode->i_mutex);
 	}
 	ovl_drop_write(dentry);