]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
btrfs: fix perms on demonstration debugfs interface
authorEric Sandeen <sandeen@redhat.com>
Wed, 31 Aug 2016 21:49:29 +0000 (16:49 -0500)
committerDavid Sterba <dsterba@suse.com>
Mon, 26 Sep 2016 15:59:49 +0000 (17:59 +0200)
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 <sandeen@redhat.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/sysfs.c

index c6569905d3d1cc5058b7a7a67785a49d6e5d1104..804bd1c42e47fd98617c6634ff3311ccd8bc25d4 100644 (file)
@@ -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;