Message ID | 20201021151903.652827-5-salyzyn@android.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | overlayfs override_creds=off & nested get xattr fix | expand |
diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index b1357bb067d9..9ab9663b02d8 100644 --- a/fs/overlayfs/file.c +++ b/fs/overlayfs/file.c @@ -53,7 +53,7 @@ static struct file *ovl_open_realfile(const struct file *file, err = inode_permission(realinode, MAY_OPEN | acc_mode); if (err) { realfile = ERR_PTR(err); - } else if (!inode_owner_or_capable(realinode)) { + } else if (old_cred && !inode_owner_or_capable(realinode)) { realfile = ERR_PTR(-EPERM); } else { realfile = open_with_fake_path(&file->f_path, flags, realinode,