summaryrefslogtreecommitdiff
path: root/fs/debugfs
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-31 09:10:03 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-31 09:10:03 +0200
commit92722bac5fe4dc4582282bad02dd1fb95e892705 (patch)
tree669a7eac6392b08965cbb5be456b9881aeb30b96 /fs/debugfs
parent39b27e89a76f3827ad93aed9213a6daf2b91f819 (diff)
parent8124c8a6b35386f73523d27eacb71b5364a68c4c (diff)
Merge 5.13-rc4 into driver-core-next
We need the driver core fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/debugfs')
-rw-r--r--fs/debugfs/inode.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index 1d252164d97b..8129a430d789 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -45,10 +45,13 @@ static unsigned int debugfs_allow __ro_after_init = DEFAULT_DEBUGFS_ALLOW_BITS;
static int debugfs_setattr(struct user_namespace *mnt_userns,
struct dentry *dentry, struct iattr *ia)
{
- int ret = security_locked_down(LOCKDOWN_DEBUGFS);
+ int ret;
- if (ret && (ia->ia_valid & (ATTR_MODE | ATTR_UID | ATTR_GID)))
- return ret;
+ if (ia->ia_valid & (ATTR_MODE | ATTR_UID | ATTR_GID)) {
+ ret = security_locked_down(LOCKDOWN_DEBUGFS);
+ if (ret)
+ return ret;
+ }
return simple_setattr(&init_user_ns, dentry, ia);
}