This is a note to let you know that I've just added the patch titled btrfs: prop: fix zstd compression parameter validation to the 5.0-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: btrfs-prop-fix-zstd-compression-parameter-validation.patch and it can be found in the queue-5.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 50398fde997f6be8faebdb5f38e9c9c467370f51 Mon Sep 17 00:00:00 2001 From: Anand Jain <anand.jain@xxxxxxxxxx> Date: Tue, 2 Apr 2019 18:07:38 +0800 Subject: btrfs: prop: fix zstd compression parameter validation From: Anand Jain <anand.jain@xxxxxxxxxx> commit 50398fde997f6be8faebdb5f38e9c9c467370f51 upstream. We let pass zstd compression parameter even if it is not fully valid. For example: $ btrfs prop set /btrfs compression zst $ btrfs prop get /btrfs compression compression=zst zlib and lzo are fine. Fix it by checking the correct prefix length. Fixes: 5c1aab1dd544 ("btrfs: Add zstd support") CC: stable@xxxxxxxxxxxxxxx # 4.14+ Reviewed-by: Nikolay Borisov <nborisov@xxxxxxxx> Signed-off-by: Anand Jain <anand.jain@xxxxxxxxxx> Reviewed-by: David Sterba <dsterba@xxxxxxxx> Signed-off-by: David Sterba <dsterba@xxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/btrfs/props.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/btrfs/props.c +++ b/fs/btrfs/props.c @@ -396,7 +396,7 @@ static int prop_compression_apply(struct btrfs_set_fs_incompat(fs_info, COMPRESS_LZO); } else if (!strncmp("zlib", value, 4)) { type = BTRFS_COMPRESS_ZLIB; - } else if (!strncmp("zstd", value, len)) { + } else if (!strncmp("zstd", value, 4)) { type = BTRFS_COMPRESS_ZSTD; btrfs_set_fs_incompat(fs_info, COMPRESS_ZSTD); } else { Patches currently in stable-queue which might be from anand.jain@xxxxxxxxxx are queue-5.0/btrfs-prop-fix-vanished-compression-property-after-failed-set.patch queue-5.0/btrfs-prop-fix-zstd-compression-parameter-validation.patch