summaryrefslogtreecommitdiffstats
path: root/fs/sysfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/sysfs')
-rw-r--r--fs/sysfs/mount.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c
index afd83273e6ce..4a2da3a4b1b1 100644
--- a/fs/sysfs/mount.c
+++ b/fs/sysfs/mount.c
@@ -112,7 +112,8 @@ static struct dentry *sysfs_mount(struct file_system_type *fs_type,
struct super_block *sb;
int error;
- if (!(flags & MS_KERNMOUNT) && !current_user_ns()->may_mount_sysfs)
+ if (!(flags & MS_KERNMOUNT) && !capable(CAP_SYS_ADMIN) &&
+ !fs_fully_visible(fs_type))
return ERR_PTR(-EPERM);
info = kzalloc(sizeof(*info), GFP_KERNEL);