btrfs: Enhanced runtime defence against fuzzed images
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest5 patches 13 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | btrfs: extent_io: Do extra check for extent buffer read write functionsfs/ | +42 | 5 replies | |
| 2/5 | btrfs: extent-tree: Kill BUG_ON() in __btrfs_free_extent() and do better commentfs/ | +131 | 2 replies | |
| 3/5 | btrfs: Detect unbalanced tree with empty leaf before crashing btree operationsfs/ fs/ | +15 | 1 reply | |
| 4/5 | btrfs: extent-tree: Kill the BUG_ON() in insert_inline_extent_backref()fs/ | +22 | 1 reply | |
| 5/5 | btrfs: ctree: Checking key orders before merged tree blocksfs/ | +63 | 4 replies |
Reviews trailers per patch
1 of 5 patches has a Reviewed-by or Acked-by.
| Patch | Nikolay Borisov |
|---|---|
| 1/5 | |
| 2/5 | |
| 3/5 | |
| 4/5 | |
| 5/5 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/5] btrfs: Enhanced runtime defence against fuzzed images
Another wave of defence enhancment, including:
- Enhanced eb accessors
Not really needed for the fuzzed images, as 448de471cd4c ("btrfs: Check the first key and level for cached extent buffer") already fixed half of the reported images.
Just add a final layer of safe net.
- BUG_ON() hunt in __btrfs_free_extent()
Kill BUG_ON()s in __btrfs_free_extent(), replace with error reporting and why it shouldn't happen.
Also add comment on what __btrfs_free_extent() is designed to do, with two dump-tree examples for newcomers.
- BUG_ON() hunt in __btrfs_inc_extent_ref()
Just like __btrfs_free_extent(), but less comment as comment for __btrfs_free_extent() should also work for __btrfs_inc_extent_ref(), and __btrfs_inc_extent_ref() has a better structure than __btrfs_free_extent().
- Defence against unbalanced empty leaf
- Defence against bad key order across two tree blocks
The last two cases can't be rejected by tree-checker and they are all cross-eb cases.
Thankfully we can reuse existing first_key check against unbalanced empty leaf, but needs extra check deep into ctree.c for tree block merging time check.
Qu Wenruo (5):
btrfs: extent_io: Do extra check for extent buffer read write
functions
btrfs: extent-tree: Kill BUG_ON() in __btrfs_free_extent() and do
better comment
btrfs: Detect unbalanced tree with empty leaf before crashing btree
operations
btrfs: extent-tree: Kill the BUG_ON() in
insert_inline_extent_backref()
btrfs: ctree: Checking key orders before merged tree blocks
fs/btrfs/ctree.c | 63 +++++++++++++++ fs/btrfs/disk-io.c | 9 +++ fs/btrfs/extent-tree.c | 168 ++++++++++++++++++++++++++++++++++++---- fs/btrfs/extent_io.c | 79 ++++++++++--------- fs/btrfs/tree-checker.c | 6 ++ 5 files changed, 273 insertions(+), 52 deletions(-)
Signature · 1 line
2.22.0