Commit 1a0608e8 authored by David Sterba's avatar David Sterba Committed by Greg Kroah-Hartman

btrfs: add check to sysfs handler of label

commit 66ac9fe7 upstream.

Add a sanity check for the fs_info as we will dereference it, similar to
what the 'store features' handler does.
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 296f8da3
......@@ -377,6 +377,9 @@ static ssize_t btrfs_label_store(struct kobject *kobj,
struct btrfs_fs_info *fs_info = to_fs_info(kobj);
size_t p_len;
if (!fs_info)
return -EPERM;
if (fs_info->sb->s_flags & MS_RDONLY)
return -EROFS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment