Revert "ANDROID: overlayfs: override_creds=off option bypass creator_cred"

This reverts commit 90f11a7d45.

The override_creds patches are no longer needed thanks to the work
documented in the below bug.

Test: adb remount still works
Bug: 388912628
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I8b64898f0968deb6ca0753df7601db4f668f0824
This commit is contained in:
Paul Lawrence
2025-02-14 13:05:01 -08:00
parent 203a476f9e
commit d3e34d865e
13 changed files with 62 additions and 130 deletions
+1 -25
View File
@@ -204,7 +204,7 @@ handle it in two different ways:
1. return EXDEV error: this error is returned by rename(2) when trying to
move a file or directory across filesystem boundaries. Hence
applications are usually prepared to handle this error (mv(1) for example
applications are usually prepared to hande this error (mv(1) for example
recursively copies the directory tree). This is the default behavior.
2. If the "redirect_dir" feature is enabled, then the directory will be
@@ -332,30 +332,6 @@ and::
The resulting access permissions should be the same. The difference is in
the time of copy (on-demand vs. up-front).
### Non overlapping credentials
As noted above, all access to the upper, lower and work directories is the
recorded mounter's MAC and DAC credentials. The incoming accesses are
checked against the caller's credentials.
It is possible, however, that the mounting process (say, init) has access to
mount an overlay, but not access to read or execute certain files in the lower
dir. Meanwhile another process may ONLY have access to files in the lower dir.
This scenario is very common in a "principle of least privilege" security
model. And in this case, using the mounter's credentials will result in access
errors for the calling process, even though the calling process can access the
lower dir.
To address this, the override_creds=off mount option will disable using the
mounter's credentials.
The ability to search and read a directory entry is spotty as a result of the
cache mechanism not re-testing the credentials because of the assumption, a
privileged caller can fill cache, then a lower privilege can read the directory
cache. The uneven security model where cache, upperdir and workdir are opened
at privilege, but accessed without creating a form of privilege escalation,
should only be used with strict understanding of the side effects and of the
security policies.
Multiple lower layers
---------------------
+15 -25
View File
@@ -163,7 +163,7 @@ ssize_t backing_file_read_iter(struct file *file, struct iov_iter *iter,
struct backing_file_ctx *ctx)
{
struct backing_aio *aio = NULL;
const struct cred *old_cred = NULL;
const struct cred *old_cred;
ssize_t ret;
if (WARN_ON_ONCE(!(file->f_mode & FMODE_BACKING)))
@@ -176,8 +176,7 @@ ssize_t backing_file_read_iter(struct file *file, struct iov_iter *iter,
!(file->f_mode & FMODE_CAN_ODIRECT))
return -EINVAL;
if (ctx->cred)
old_cred = override_creds(ctx->cred);
old_cred = override_creds(ctx->cred);
if (is_sync_kiocb(iocb)) {
rwf_t rwf = iocb_to_rw_flags(flags);
@@ -198,8 +197,7 @@ ssize_t backing_file_read_iter(struct file *file, struct iov_iter *iter,
backing_aio_cleanup(aio, ret);
}
out:
if (old_cred)
revert_creds(old_cred);
revert_creds(old_cred);
if (ctx->accessed)
ctx->accessed(ctx->user_file);
@@ -212,7 +210,7 @@ ssize_t backing_file_write_iter(struct file *file, struct iov_iter *iter,
struct kiocb *iocb, int flags,
struct backing_file_ctx *ctx)
{
const struct cred *old_cred = NULL;
const struct cred *old_cred;
ssize_t ret;
if (WARN_ON_ONCE(!(file->f_mode & FMODE_BACKING)))
@@ -235,8 +233,7 @@ ssize_t backing_file_write_iter(struct file *file, struct iov_iter *iter,
*/
flags &= ~IOCB_DIO_CALLER_COMP;
if (ctx->cred)
old_cred = override_creds(ctx->cred);
old_cred = override_creds(ctx->cred);
if (is_sync_kiocb(iocb)) {
rwf_t rwf = iocb_to_rw_flags(flags);
@@ -267,8 +264,7 @@ ssize_t backing_file_write_iter(struct file *file, struct iov_iter *iter,
backing_aio_cleanup(aio, ret);
}
out:
if (old_cred)
revert_creds(old_cred);
revert_creds(old_cred);
return ret;
}
@@ -279,17 +275,15 @@ ssize_t backing_file_splice_read(struct file *in, loff_t *ppos,
unsigned int flags,
struct backing_file_ctx *ctx)
{
const struct cred *old_cred = NULL;
const struct cred *old_cred;
ssize_t ret;
if (WARN_ON_ONCE(!(in->f_mode & FMODE_BACKING)))
return -EIO;
if (ctx->cred)
old_cred = override_creds(ctx->cred);
old_cred = override_creds(ctx->cred);
ret = vfs_splice_read(in, ppos, pipe, len, flags);
if (old_cred)
revert_creds(old_cred);
revert_creds(old_cred);
if (ctx->accessed)
ctx->accessed(ctx->user_file);
@@ -303,7 +297,7 @@ ssize_t backing_file_splice_write(struct pipe_inode_info *pipe,
unsigned int flags,
struct backing_file_ctx *ctx)
{
const struct cred *old_cred = NULL;
const struct cred *old_cred;
ssize_t ret;
if (WARN_ON_ONCE(!(out->f_mode & FMODE_BACKING)))
@@ -316,13 +310,11 @@ ssize_t backing_file_splice_write(struct pipe_inode_info *pipe,
if (ret)
return ret;
if (ctx->cred)
old_cred = override_creds(ctx->cred);
old_cred = override_creds(ctx->cred);
file_start_write(out);
ret = out->f_op->splice_write(pipe, out, ppos, len, flags);
file_end_write(out);
if (old_cred)
revert_creds(old_cred);
revert_creds(old_cred);
if (ctx->end_write)
ctx->end_write(ctx->user_file, ppos ? *ppos : 0, ret);
@@ -334,7 +326,7 @@ EXPORT_SYMBOL_GPL(backing_file_splice_write);
int backing_file_mmap(struct file *file, struct vm_area_struct *vma,
struct backing_file_ctx *ctx)
{
const struct cred *old_cred = NULL;
const struct cred *old_cred;
int ret;
if (WARN_ON_ONCE(!(file->f_mode & FMODE_BACKING)) ||
@@ -346,11 +338,9 @@ int backing_file_mmap(struct file *file, struct vm_area_struct *vma,
vma_set_file(vma, file);
if (ctx->cred)
old_cred = override_creds(ctx->cred);
old_cred = override_creds(ctx->cred);
ret = call_mmap(vma->vm_file, vma);
if (old_cred)
revert_creds(old_cred);
revert_creds(old_cred);
if (ctx->accessed)
ctx->accessed(ctx->user_file);
+1 -1
View File
@@ -1260,7 +1260,7 @@ static int ovl_copy_up_flags(struct dentry *dentry, int flags)
dput(parent);
dput(next);
}
ovl_revert_creds(dentry->d_sb, old_cred);
revert_creds(old_cred);
return err;
}
+12 -22
View File
@@ -554,8 +554,7 @@ out_cleanup:
}
static int ovl_setup_cred_for_create(struct dentry *dentry, struct inode *inode,
umode_t mode, const struct cred *old_cred,
const struct cred **hold_cred)
umode_t mode, const struct cred *old_cred)
{
int err;
struct cred *override_cred;
@@ -572,8 +571,9 @@ static int ovl_setup_cred_for_create(struct dentry *dentry, struct inode *inode,
put_cred(override_cred);
return err;
}
*hold_cred = override_creds(override_cred);
put_cred(override_creds(override_cred));
put_cred(override_cred);
return 0;
}
@@ -581,7 +581,7 @@ static int ovl_create_or_link(struct dentry *dentry, struct inode *inode,
struct ovl_cattr *attr, bool origin)
{
int err;
const struct cred *old_cred, *hold_cred = NULL;
const struct cred *old_cred;
struct dentry *parent = dentry->d_parent;
old_cred = ovl_override_creds(dentry->d_sb);
@@ -609,13 +609,8 @@ static int ovl_create_or_link(struct dentry *dentry, struct inode *inode,
* But in the other hardlink case, ovl_link() does not
* create a new inode, so just use the ovl mounter's
* fs{u,g}id.
*
* Retain current_cred() via hold_cred, since we need to
* restore it if old_cred was NULL.
*/
err = ovl_setup_cred_for_create(dentry, inode, attr->mode,
old_cred ?: current_cred(),
&hold_cred);
err = ovl_setup_cred_for_create(dentry, inode, attr->mode, old_cred);
if (err)
goto out_revert_creds;
}
@@ -626,9 +621,7 @@ static int ovl_create_or_link(struct dentry *dentry, struct inode *inode,
err = ovl_create_over_whiteout(dentry, inode, attr);
out_revert_creds:
ovl_revert_creds(dentry->d_sb, old_cred ?: hold_cred);
if (old_cred && hold_cred)
put_cred(hold_cred);
revert_creds(old_cred);
return err;
}
@@ -709,7 +702,7 @@ static int ovl_set_link_redirect(struct dentry *dentry)
old_cred = ovl_override_creds(dentry->d_sb);
err = ovl_set_redirect(dentry, false);
ovl_revert_creds(dentry->d_sb, old_cred);
revert_creds(old_cred);
return err;
}
@@ -919,7 +912,7 @@ static int ovl_do_remove(struct dentry *dentry, bool is_dir)
err = ovl_remove_upper(dentry, is_dir, &list);
else
err = ovl_remove_and_whiteout(dentry, &list);
ovl_revert_creds(dentry->d_sb, old_cred);
revert_creds(old_cred);
if (!err) {
if (is_dir)
clear_nlink(dentry->d_inode);
@@ -1299,7 +1292,7 @@ out_dput_old:
out_unlock:
unlock_rename(new_upperdir, old_upperdir);
out_revert_creds:
ovl_revert_creds(old->d_sb, old_cred);
revert_creds(old_cred);
if (update_nlink)
ovl_nlink_end(new);
else
@@ -1313,7 +1306,7 @@ out:
static int ovl_create_tmpfile(struct file *file, struct dentry *dentry,
struct inode *inode, umode_t mode)
{
const struct cred *old_cred, *hold_cred = NULL;
const struct cred *old_cred;
struct path realparentpath;
struct file *realfile;
struct dentry *newdentry;
@@ -1322,8 +1315,7 @@ static int ovl_create_tmpfile(struct file *file, struct dentry *dentry,
int err;
old_cred = ovl_override_creds(dentry->d_sb);
err = ovl_setup_cred_for_create(dentry, inode, mode,
old_cred ?: current_cred(), &hold_cred);
err = ovl_setup_cred_for_create(dentry, inode, mode, old_cred);
if (err)
goto out_revert_creds;
@@ -1345,9 +1337,7 @@ static int ovl_create_tmpfile(struct file *file, struct dentry *dentry,
fput(realfile);
}
out_revert_creds:
ovl_revert_creds(dentry->d_sb, old_cred ?: hold_cred);
if (old_cred && hold_cred)
put_cred(hold_cred);
revert_creds(old_cred);
return err;
}
+7 -7
View File
@@ -52,7 +52,7 @@ static struct file *ovl_open_realfile(const struct file *file,
realfile = backing_file_open(&file->f_path, flags, realpath,
current_cred());
}
ovl_revert_creds(inode->i_sb, old_cred);
revert_creds(old_cred);
pr_debug("open(%p[%pD2/%c], 0%o) -> (%p, 0%o)\n",
file, file, ovl_whatisit(inode, realinode), file->f_flags,
@@ -216,7 +216,7 @@ static loff_t ovl_llseek(struct file *file, loff_t offset, int whence)
old_cred = ovl_override_creds(inode->i_sb);
ret = vfs_llseek(fd_file(real), offset, whence);
ovl_revert_creds(inode->i_sb, old_cred);
revert_creds(old_cred);
file->f_pos = fd_file(real)->f_pos;
ovl_inode_unlock(inode);
@@ -408,7 +408,7 @@ static int ovl_fsync(struct file *file, loff_t start, loff_t end, int datasync)
if (file_inode(fd_file(real)) == ovl_inode_upper(file_inode(file))) {
old_cred = ovl_override_creds(file_inode(file)->i_sb);
ret = vfs_fsync_range(fd_file(real), start, end, datasync);
ovl_revert_creds(file_inode(file)->i_sb, old_cred);
revert_creds(old_cred);
}
fdput(real);
@@ -448,7 +448,7 @@ static long ovl_fallocate(struct file *file, int mode, loff_t offset, loff_t len
old_cred = ovl_override_creds(file_inode(file)->i_sb);
ret = vfs_fallocate(fd_file(real), mode, offset, len);
ovl_revert_creds(file_inode(file)->i_sb, old_cred);
revert_creds(old_cred);
/* Update size */
ovl_file_modified(file);
@@ -473,7 +473,7 @@ static int ovl_fadvise(struct file *file, loff_t offset, loff_t len, int advice)
old_cred = ovl_override_creds(file_inode(file)->i_sb);
ret = vfs_fadvise(fd_file(real), offset, len, advice);
ovl_revert_creds(file_inode(file)->i_sb, old_cred);
revert_creds(old_cred);
fdput(real);
@@ -532,7 +532,7 @@ static loff_t ovl_copyfile(struct file *file_in, loff_t pos_in,
flags);
break;
}
ovl_revert_creds(file_inode(file_out)->i_sb, old_cred);
revert_creds(old_cred);
/* Update size */
ovl_file_modified(file_out);
@@ -594,7 +594,7 @@ static int ovl_flush(struct file *file, fl_owner_t id)
if (fd_file(real)->f_op->flush) {
old_cred = ovl_override_creds(file_inode(file)->i_sb);
err = fd_file(real)->f_op->flush(fd_file(real), id);
ovl_revert_creds(file_inode(file)->i_sb, old_cred);
revert_creds(old_cred);
}
fdput(real);
+10 -10
View File
@@ -80,7 +80,7 @@ int ovl_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
inode_lock(upperdentry->d_inode);
old_cred = ovl_override_creds(dentry->d_sb);
err = ovl_do_notify_change(ofs, upperdentry, attr);
ovl_revert_creds(dentry->d_sb, old_cred);
revert_creds(old_cred);
if (!err)
ovl_copyattr(dentry->d_inode);
inode_unlock(upperdentry->d_inode);
@@ -280,7 +280,7 @@ int ovl_getattr(struct mnt_idmap *idmap, const struct path *path,
stat->nlink = dentry->d_inode->i_nlink;
out:
ovl_revert_creds(dentry->d_sb, old_cred);
revert_creds(old_cred);
return err;
}
@@ -317,7 +317,7 @@ int ovl_permission(struct mnt_idmap *idmap,
mask |= MAY_READ;
}
err = inode_permission(mnt_idmap(realpath.mnt), realinode, mask);
ovl_revert_creds(inode->i_sb, old_cred);
revert_creds(old_cred);
return err;
}
@@ -334,7 +334,7 @@ static const char *ovl_get_link(struct dentry *dentry,
old_cred = ovl_override_creds(dentry->d_sb);
p = vfs_get_link(ovl_dentry_real(dentry), done);
ovl_revert_creds(dentry->d_sb, old_cred);
revert_creds(old_cred);
return p;
}
@@ -469,7 +469,7 @@ struct posix_acl *do_ovl_get_acl(struct mnt_idmap *idmap,
old_cred = ovl_override_creds(inode->i_sb);
acl = ovl_get_acl_path(&realpath, posix_acl_xattr_name(type), noperm);
ovl_revert_creds(inode->i_sb, old_cred);
revert_creds(old_cred);
}
return acl;
@@ -498,7 +498,7 @@ static int ovl_set_or_remove_acl(struct dentry *dentry, struct inode *inode,
old_cred = ovl_override_creds(dentry->d_sb);
real_acl = vfs_get_acl(mnt_idmap(realpath.mnt), realdentry,
acl_name);
ovl_revert_creds(dentry->d_sb, old_cred);
revert_creds(old_cred);
if (IS_ERR(real_acl)) {
err = PTR_ERR(real_acl);
goto out;
@@ -523,7 +523,7 @@ static int ovl_set_or_remove_acl(struct dentry *dentry, struct inode *inode,
err = ovl_do_set_acl(ofs, realdentry, acl_name, acl);
else
err = ovl_do_remove_acl(ofs, realdentry, acl_name);
ovl_revert_creds(dentry->d_sb, old_cred);
revert_creds(old_cred);
ovl_drop_write(dentry);
/* copy c/mtime */
@@ -600,7 +600,7 @@ static int ovl_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
old_cred = ovl_override_creds(inode->i_sb);
err = realinode->i_op->fiemap(realinode, fieinfo, start, len);
ovl_revert_creds(inode->i_sb, old_cred);
revert_creds(old_cred);
return err;
}
@@ -676,7 +676,7 @@ int ovl_fileattr_set(struct mnt_idmap *idmap,
err = ovl_set_protattr(inode, upperpath.dentry, fa);
if (!err)
err = ovl_real_fileattr_set(&upperpath, fa);
ovl_revert_creds(inode->i_sb, old_cred);
revert_creds(old_cred);
ovl_drop_write(dentry);
/*
@@ -738,7 +738,7 @@ int ovl_fileattr_get(struct dentry *dentry, struct fileattr *fa)
old_cred = ovl_override_creds(inode->i_sb);
err = ovl_real_fileattr_get(&realpath, fa);
ovl_fileattr_prot_flags(inode, fa);
ovl_revert_creds(inode->i_sb, old_cred);
revert_creds(old_cred);
return err;
}
+5 -5
View File
@@ -961,7 +961,7 @@ static int ovl_maybe_validate_verity(struct dentry *dentry)
if (err == 0)
ovl_set_flag(OVL_VERIFIED_DIGEST, inode);
ovl_revert_creds(dentry->d_sb, old_cred);
revert_creds(old_cred);
}
ovl_inode_unlock(inode);
@@ -995,7 +995,7 @@ static int ovl_maybe_lookup_lowerdata(struct dentry *dentry)
old_cred = ovl_override_creds(dentry->d_sb);
err = ovl_lookup_data_layers(dentry, redirect, &datapath);
ovl_revert_creds(dentry->d_sb, old_cred);
revert_creds(old_cred);
if (err)
goto out_err;
@@ -1342,7 +1342,7 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
ovl_dentry_init_reval(dentry, upperdentry, OVL_I_E(inode));
ovl_revert_creds(dentry->d_sb, old_cred);
revert_creds(old_cred);
if (origin_path) {
dput(origin_path->dentry);
kfree(origin_path);
@@ -1366,7 +1366,7 @@ out_put_upper:
kfree(upperredirect);
out:
kfree(d.redirect);
ovl_revert_creds(dentry->d_sb, old_cred);
revert_creds(old_cred);
return ERR_PTR(err);
}
@@ -1423,7 +1423,7 @@ bool ovl_lower_positive(struct dentry *dentry)
dput(this);
}
}
ovl_revert_creds(dentry->d_sb, old_cred);
revert_creds(old_cred);
return positive;
}
+1 -6
View File
@@ -429,15 +429,10 @@ int ovl_want_write(struct dentry *dentry);
void ovl_drop_write(struct dentry *dentry);
struct dentry *ovl_workdir(struct dentry *dentry);
const struct cred *ovl_override_creds(struct super_block *sb);
void ovl_revert_creds(struct super_block *sb, const struct cred *oldcred);
static inline const struct cred *ovl_creds(struct super_block *sb)
{
struct ovl_fs *ofs = OVL_FS(sb);
if (!ofs->config.override_creds)
return NULL;
return ofs->creator_cred;
return OVL_FS(sb)->creator_cred;
}
int ovl_can_decode_fh(struct super_block *sb);
-1
View File
@@ -19,7 +19,6 @@ struct ovl_config {
bool metacopy;
bool userxattr;
bool ovl_volatile;
bool override_creds;
};
struct ovl_sb {
-10
View File
@@ -43,11 +43,6 @@ module_param_named(metacopy, ovl_metacopy_def, bool, 0644);
MODULE_PARM_DESC(metacopy,
"Default to on or off for the metadata only copy up feature");
static bool __read_mostly ovl_override_creds_def = true;
module_param_named(override_creds, ovl_override_creds_def, bool, 0644);
MODULE_PARM_DESC(ovl_override_creds_def,
"Use mounter's credentials for accesses");
enum ovl_opt {
Opt_lowerdir,
Opt_lowerdir_add,
@@ -64,7 +59,6 @@ enum ovl_opt {
Opt_metacopy,
Opt_verity,
Opt_volatile,
Opt_override_creds,
};
static const struct constant_table ovl_parameter_bool[] = {
@@ -161,7 +155,6 @@ const struct fs_parameter_spec ovl_parameter_spec[] = {
fsparam_enum("metacopy", Opt_metacopy, ovl_parameter_bool),
fsparam_enum("verity", Opt_verity, ovl_parameter_verity),
fsparam_flag("volatile", Opt_volatile),
fsparam_enum("override_creds", Opt_override_creds, ovl_parameter_bool),
{}
};
@@ -603,9 +596,6 @@ static int ovl_parse_param(struct fs_context *fc, struct fs_parameter *param)
case Opt_userxattr:
config->userxattr = true;
break;
case Opt_override_creds:
config->override_creds = result.uint_32;
break;
default:
pr_err("unrecognized mount option \"%s\" or missing value\n",
param->key);
+4 -4
View File
@@ -290,7 +290,7 @@ static int ovl_check_whiteouts(const struct path *path, struct ovl_readdir_data
}
inode_unlock(dir->d_inode);
}
ovl_revert_creds(rdd->dentry->d_sb, old_cred);
revert_creds(old_cred);
return err;
}
@@ -808,7 +808,7 @@ static int ovl_iterate(struct file *file, struct dir_context *ctx)
}
err = 0;
out:
ovl_revert_creds(dentry->d_sb, old_cred);
revert_creds(old_cred);
return err;
}
@@ -860,7 +860,7 @@ static struct file *ovl_dir_open_realfile(const struct file *file,
old_cred = ovl_override_creds(file_inode(file)->i_sb);
res = ovl_path_open(realpath, O_RDONLY | (file->f_flags & O_LARGEFILE));
ovl_revert_creds(file_inode(file)->i_sb, old_cred);
revert_creds(old_cred);
return res;
}
@@ -987,7 +987,7 @@ int ovl_check_empty_dir(struct dentry *dentry, struct list_head *list)
old_cred = ovl_override_creds(dentry->d_sb);
err = ovl_dir_read_merged(dentry, list, &root);
ovl_revert_creds(dentry->d_sb, old_cred);
revert_creds(old_cred);
if (err)
return err;
+2 -10
View File
@@ -65,17 +65,9 @@ const struct cred *ovl_override_creds(struct super_block *sb)
{
struct ovl_fs *ofs = OVL_FS(sb);
if (!ofs->config.override_creds)
return NULL;
return override_creds(ofs->creator_cred);
}
void ovl_revert_creds(struct super_block *sb, const struct cred *old_cred)
{
if (old_cred)
revert_creds(old_cred);
}
/*
* Check if underlying fs supports file handles and try to determine encoding
* type, in order to deduce maximum inode number used by fs.
@@ -1189,7 +1181,7 @@ int ovl_nlink_start(struct dentry *dentry)
* value relative to the upper inode nlink in an upper inode xattr.
*/
err = ovl_set_nlink_upper(dentry);
ovl_revert_creds(dentry->d_sb, old_cred);
revert_creds(old_cred);
if (err)
goto out_drop_write;
@@ -1214,7 +1206,7 @@ void ovl_nlink_end(struct dentry *dentry)
old_cred = ovl_override_creds(dentry->d_sb);
ovl_cleanup_index(dentry);
ovl_revert_creds(dentry->d_sb, old_cred);
revert_creds(old_cred);
}
ovl_inode_unlock(inode);
+4 -4
View File
@@ -47,7 +47,7 @@ static int ovl_xattr_set(struct dentry *dentry, struct inode *inode, const char
ovl_path_lower(dentry, &realpath);
old_cred = ovl_override_creds(dentry->d_sb);
err = vfs_getxattr(mnt_idmap(realpath.mnt), realdentry, name, NULL, 0);
ovl_revert_creds(dentry->d_sb, old_cred);
revert_creds(old_cred);
if (err < 0)
goto out;
}
@@ -72,7 +72,7 @@ static int ovl_xattr_set(struct dentry *dentry, struct inode *inode, const char
WARN_ON(flags != XATTR_REPLACE);
err = ovl_do_removexattr(ofs, realdentry, name);
}
ovl_revert_creds(dentry->d_sb, old_cred);
revert_creds(old_cred);
ovl_drop_write(dentry);
/* copy c/mtime */
@@ -91,7 +91,7 @@ static int ovl_xattr_get(struct dentry *dentry, struct inode *inode, const char
ovl_i_path_real(inode, &realpath);
old_cred = ovl_override_creds(dentry->d_sb);
res = vfs_getxattr(mnt_idmap(realpath.mnt), realpath.dentry, name, value, size);
ovl_revert_creds(dentry->d_sb, old_cred);
revert_creds(old_cred);
return res;
}
@@ -121,7 +121,7 @@ ssize_t ovl_listxattr(struct dentry *dentry, char *list, size_t size)
old_cred = ovl_override_creds(dentry->d_sb);
res = vfs_listxattr(realdentry, list, size);
ovl_revert_creds(dentry->d_sb, old_cred);
revert_creds(old_cred);
if (res <= 0 || size == 0)
return res;