btrfs: harden parsing of compression mount options
authorDaniel Vacek <neelx@suse.com>
Mon, 2 Jun 2025 15:53:19 +0000 (17:53 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Jul 2025 21:53:26 +0000 (23:53 +0200)
commit3f093ccb95f30f95b7c6014d1f0b6847299190c2
tree202aec27c098f045433528774b85fe50beb4c8dc
parent3f0e865ae61ed8c023b72b1ae6c186024b0aec1f
btrfs: harden parsing of compression mount options

Btrfs happily but incorrectly accepts the `-o compress=zlib+foo` and similar
options with any random suffix.

Fix that by explicitly checking the end of the strings.

Signed-off-by: Daniel Vacek <neelx@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/super.c