Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3c77b07d authored by Gu Jinxiang's avatar Gu Jinxiang Committed by Greg Kroah-Hartman
Browse files

btrfs: validate type when reading a chunk

commit 315409b0098fb2651d86553f0436b70502b29bb2 upstream.

Reported in https://bugzilla.kernel.org/show_bug.cgi?id=199839, with an
image that has an invalid chunk type but does not return an error.

Add chunk type check in btrfs_check_chunk_valid, to detect the wrong
type combinations.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=199839


Reported-by: default avatarXu Wen <wen.xu@gatech.edu>
Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
Signed-off-by: default avatarGu Jinxiang <gujx@cn.fujitsu.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
[bwh: Backported to 4.9: Use root->fs_info instead of fs_info]
Signed-off-by: default avatarBen Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 447effd3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment