]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.0.23/ecryptfs-copy-up-lower-inode-attrs-after-setting-lower-xattr.patch
Fix up backported ptrace patch
[thirdparty/kernel/stable-queue.git] / releases / 3.0.23 / ecryptfs-copy-up-lower-inode-attrs-after-setting-lower-xattr.patch
1 From 545d680938be1e86a6c5250701ce9abaf360c495 Mon Sep 17 00:00:00 2001
2 From: Tyler Hicks <tyhicks@canonical.com>
3 Date: Tue, 7 Feb 2012 17:55:40 -0600
4 Subject: eCryptfs: Copy up lower inode attrs after setting lower xattr
5
6 From: Tyler Hicks <tyhicks@canonical.com>
7
8 commit 545d680938be1e86a6c5250701ce9abaf360c495 upstream.
9
10 After passing through a ->setxattr() call, eCryptfs needs to copy the
11 inode attributes from the lower inode to the eCryptfs inode, as they
12 may have changed in the lower filesystem's ->setxattr() path.
13
14 One example is if an extended attribute containing a POSIX Access
15 Control List is being set. The new ACL may cause the lower filesystem to
16 modify the mode of the lower inode and the eCryptfs inode would need to
17 be updated to reflect the new mode.
18
19 https://launchpad.net/bugs/926292
20
21 Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
22 Reported-by: Sebastien Bacher <seb128@ubuntu.com>
23 Cc: John Johansen <john.johansen@canonical.com>
24 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
25
26 ---
27 fs/ecryptfs/inode.c | 2 ++
28 1 file changed, 2 insertions(+)
29
30 --- a/fs/ecryptfs/inode.c
31 +++ b/fs/ecryptfs/inode.c
32 @@ -1119,6 +1119,8 @@ ecryptfs_setxattr(struct dentry *dentry,
33 }
34
35 rc = vfs_setxattr(lower_dentry, name, value, size, flags);
36 + if (!rc)
37 + fsstack_copy_attr_all(dentry->d_inode, lower_dentry->d_inode);
38 out:
39 return rc;
40 }