Btrfs: improve check_node to avoid reading corrupted nodes
commitd6719cf116b2fc8a7f51e84430c28febfac1eded
authorLiu Bo <bo.li.liu@oracle.com>
Thu, 15 Sep 2016 00:23:24 +0000 (14 17:23 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Jan 2019 21:16:07 +0000 (16 22:16 +0100)
tree95295de6e689196b91d0e88080f73ceabf0fc2be
parent731b8667952815844de39412fb202292cf679f38
Btrfs: improve check_node to avoid reading corrupted nodes

commit 6b722c1747d533ac6d4df110dc8233db46918b65 upstream.

We need to check items in a node to make sure that we're reading
a valid one, otherwise we could get various crashes while processing
delayed_refs.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/disk-io.c