aboutsummaryrefslogtreecommitdiff
path: root/lib/mpi/mpi-mul.c
diff options
context:
space:
mode:
authorQu Wenruo <[email protected]>2019-12-17 18:58:20 +0800
committerDavid Sterba <[email protected]>2020-01-20 16:40:56 +0100
commitf6d2a5c263afca84646cf3300dc13061bedbd99e (patch)
tree8a90ee52722dc29dedfd8a1263ce51764183d804 /lib/mpi/mpi-mul.c
parent0ab575c5df5e4a7eb3a80c682de1165189d888e0 (diff)
btrfs: tree-checker: Check leaf chunk item size
Inspired by btrfs-progs github issue #208, where chunk item in chunk tree has invalid num_stripes (0). Although that can already be caught by current btrfs_check_chunk_valid(), that function doesn't really check item size as it needs to handle chunk item in super block sys_chunk_array(). This patch will add two extra checks for chunk items in chunk tree: - Basic chunk item size If the item is smaller than btrfs_chunk (which already contains one stripe), exit right now as reading num_stripes may even go beyond eb boundary. - Item size check against num_stripes If item size doesn't match with calculated chunk size, then either the item size or the num_stripes is corrupted. Error out anyway. Reviewed-by: Josef Bacik <[email protected]> Signed-off-by: Qu Wenruo <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'lib/mpi/mpi-mul.c')
0 files changed, 0 insertions, 0 deletions