From: Eric Sandeen Date: Wed, 31 Aug 2016 21:49:29 +0000 (-0500) Subject: btrfs: fix perms on demonstration debugfs interface X-Git-Tag: v4.9-rc1~46^2~37 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=07f6a480436595394a06a69d0ebc18fef6736197;p=linux.git btrfs: fix perms on demonstration debugfs interface btrfs provides a helpful demonstration of how to export a global variable via debugfs; however, it is unique among other debugfs files in that it is world-writable, which causes some concern to people who are not familiar with its purpose. Fix it so that it is only user-writable. Signed-off-by: Eric Sandeen Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index c6569905d3d1..804bd1c42e47 100644 --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c @@ -836,7 +836,7 @@ static int btrfs_init_debugfs(void) if (!btrfs_debugfs_root_dentry) return -ENOMEM; - debugfs_create_u64("test", S_IRUGO | S_IWUGO, btrfs_debugfs_root_dentry, + debugfs_create_u64("test", S_IRUGO | S_IWUSR, btrfs_debugfs_root_dentry, &btrfs_debugfs_test); #endif return 0;