btrfs-progs: fsck: Check drop level before walking through fs tree
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Tue, 30 Aug 2016 07:22:13 +0000 (15:22 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 5 Sep 2016 08:04:32 +0000 (10:04 +0200)
commit0d2c2d480918eb2b939ebcc6057548d4d808d829
treee455492dde51bcb7977780962f8b8e4873074089
parentba23b7679fb85e55cb28239e65a58a4f47e9f739
btrfs-progs: fsck: Check drop level before walking through fs tree

Exposed by fuzzed image from Lukas, which contains invalid drop level
(16), causing segfault when accessing path->nodes[drop_level].

This patch will check drop level against fs tree level and
BTRFS_MAX_LEVEL to avoid such problem.

Reported-by: Lukas Lueg <lukas.lueg@gmail.com>
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
cmds-check.c