Skip to content

Commit 1a49a97

Browse files
danobikdave
authored andcommitted
btrfs: tree-checker: add missing return after error in root_item
There's a missing return statement after an error is found in the root_item, this can cause further problems when a crafted image triggers the error. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=210181 Fixes: 259ee77 ("btrfs: tree-checker: Add ROOT_ITEM check") CC: stable@vger.kernel.org # 5.4+ Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Daniel Xu <dxu@dxuuu.xyz> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 6f23277 commit 1a49a97

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/btrfs/tree-checker.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,6 +1068,7 @@ static int check_root_item(struct extent_buffer *leaf, struct btrfs_key *key,
10681068
"invalid root item size, have %u expect %zu or %u",
10691069
btrfs_item_size_nr(leaf, slot), sizeof(ri),
10701070
btrfs_legacy_root_item_size());
1071+
return -EUCLEAN;
10711072
}
10721073

10731074
/*

0 commit comments

Comments
 (0)