Skip to content

Commit 554677b

Browse files
author
Miklos Szeredi
committed
ovl: perform vfs_getxattr() with mounter creds
The vfs_getxattr() in ovl_xattr_set() is used to check whether an xattr exist on a lower layer file that is to be removed. If the xattr does not exist, then no need to copy up the file. This call of vfs_getxattr() wasn't wrapped in credential override, and this is probably okay. But for consitency wrap this instance as well. Reported-by: "Eric W. Biederman" <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
1 parent 9efb069 commit 554677b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/overlayfs/inode.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,9 @@ int ovl_xattr_set(struct dentry *dentry, struct inode *inode, const char *name,
352352
goto out;
353353

354354
if (!value && !upperdentry) {
355+
old_cred = ovl_override_creds(dentry->d_sb);
355356
err = vfs_getxattr(realdentry, name, NULL, 0);
357+
revert_creds(old_cred);
356358
if (err < 0)
357359
goto out_drop_write;
358360
}

0 commit comments

Comments
 (0)