summaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorDaniel Xu <dxu@dxuuu.xyz>2020-11-12 17:55:06 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-12-02 08:49:44 +0100
commit0115a26133976c359841ee59c65d9f01b11b3970 (patch)
tree38649d8d850ac29a462b33af14fc344484c860f4 /fs/btrfs
parent6ec51459df7117dbe9b1fef2174951f80877a850 (diff)
downloadlinux-stable-0115a26133976c359841ee59c65d9f01b11b3970.tar.gz
linux-stable-0115a26133976c359841ee59c65d9f01b11b3970.tar.bz2
linux-stable-0115a26133976c359841ee59c65d9f01b11b3970.zip
btrfs: tree-checker: add missing return after error in root_item
commit 1a49a97df657c63a4e8ffcd1ea9b6ed95581789b upstream. 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: 259ee7754b67 ("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/tree-checker.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
index 48e46323d519..70df55774222 100644
--- a/fs/btrfs/tree-checker.c
+++ b/fs/btrfs/tree-checker.c
@@ -913,6 +913,7 @@ static int check_root_item(struct extent_buffer *leaf, struct btrfs_key *key,
"invalid root item size, have %u expect %zu or %u",
btrfs_item_size_nr(leaf, slot), sizeof(ri),
btrfs_legacy_root_item_size());
+ return -EUCLEAN;
}
/*