Skip to content

btrfs: tree-checker: Enhancement and fixes for new fuzzed image report

Qu Wenruo linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3btrfs: tree-checker: Verify chunk itemsfs/btrfs/tree-checker.c fs/btrfs/tree-checker.h fs/btrfs/volumes.c+156 -936 replies
2/3btrfs: tree-checker: Verify dev itemfs/btrfs/tree-checker.c fs/btrfs/volumes.c fs/btrfs/volumes.h+93 -90 replies
3/3btrfs: tree-checker: Fix NULL pointer access for corrupted chunk rootfs/btrfs/tree-checker.c+5 -10 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchNikolay Borisov
1/3R-b
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] btrfs: tree-checker: Enhancement and fixes for new fuzzed image report

This patchset can be fetched from:
https://github.com/adam900710/linux/tree/tree_checker_enhancement

The base branch write_time_tree_checker, the base commit is:
commit cb3ba69132a83d5e87f243dece5db09a022b0be7 (github/write_time_tree_checker, write_time_tree_checker)

Author: Qu Wenruo <[email protected]>
Date:   Thu Jan 17 15:15:14 2019 +0800

btrfs: Do mandatory tree block check before submitting bio

Yoon Jungyeon reported several fuzzed image screwing up btrfs.

3 of the reported images are mount panic and can be addressed by tree checker enhancement and fix.

This patchset addresses those 3 mount panic by:
- Verify chunk items
This merges the existing btrfs_check_chunk_valid() and apply it to all chunk items, both in super block syschunk array and all tree blocks.

- Verify dev item
This could avoid NULL pointer workaround for seed dummy.

- Don't trigger comprehensive root owner check if tree root is not initialized yet

The remaining runtime problem needs extra inspection, and some isn't so easy to fix by tree-checker alone.

Qu Wenruo (3):
btrfs: tree-checker: Verify chunk items
btrfs: tree-checker: Verify dev item
btrfs: tree-checker: Fix NULL pointer access for corrupted chunk root

 fs/btrfs/tree-checker.c | 242 +++++++++++++++++++++++++++++++++++++++-
 fs/btrfs/tree-checker.h |   3 +
 fs/btrfs/volumes.c      | 103 +----------------
 fs/btrfs/volumes.h      |   9 ++
 4 files changed, 254 insertions(+), 103 deletions(-)
Signature · 1 line
2.21.0