Commit bec4c296 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'ecryptfs-5.11-rc6-setxattr-fix' of...

Merge tag 'ecryptfs-5.11-rc6-setxattr-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs

Pull ecryptfs fix from Tyler Hicks:
 "Fix a regression that resulted in two rounds of UID translations when
  setting v3 namespaced file capabilities in some configurations"

* tag 'ecryptfs-5.11-rc6-setxattr-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs:
  ecryptfs: fix uid translation for setxattr on security.capability
parents 909b447d 0b964446
...@@ -1016,15 +1016,19 @@ ecryptfs_setxattr(struct dentry *dentry, struct inode *inode, ...@@ -1016,15 +1016,19 @@ ecryptfs_setxattr(struct dentry *dentry, struct inode *inode,
{ {
int rc; int rc;
struct dentry *lower_dentry; struct dentry *lower_dentry;
struct inode *lower_inode;
lower_dentry = ecryptfs_dentry_to_lower(dentry); lower_dentry = ecryptfs_dentry_to_lower(dentry);
if (!(d_inode(lower_dentry)->i_opflags & IOP_XATTR)) { lower_inode = d_inode(lower_dentry);
if (!(lower_inode->i_opflags & IOP_XATTR)) {
rc = -EOPNOTSUPP; rc = -EOPNOTSUPP;
goto out; goto out;
} }
rc = vfs_setxattr(lower_dentry, name, value, size, flags); inode_lock(lower_inode);
rc = __vfs_setxattr_locked(lower_dentry, name, value, size, flags, NULL);
inode_unlock(lower_inode);
if (!rc && inode) if (!rc && inode)
fsstack_copy_attr_all(inode, d_inode(lower_dentry)); fsstack_copy_attr_all(inode, lower_inode);
out: out:
return rc; return rc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment