DragonOS/kernel/crates/another_ext4/ext4_fuse
LoGin acee8d2173
fix(ext4): propagate block I/O errors and harden extent corruption handling (#1791)
Replace panic-prone block access paths with proper error propagation and add
validation for corrupted extent metadata.

- change `another_ext4::BlockDevice` to return `Result` for `read_block` and
  `write_block`
- remove `unwrap()`-based panic behavior in DragonOS ext4 gendisk adapter
- propagate I/O errors through ext4 rw/dir/alloc/low_level/high_level paths
- harden extent traversal with:
  - pblock range checks against superblock block count
  - extent header sanity checks (magic/depth/entries)
  - index ordering and leaf overlap/zero-length validation
  - empty-index underflow fix in `search_extent_index`
- add regression tests for:
  - extent header magic validation
  - empty extent-index behavior
  - out-of-range pblock rejection
  - overlapped/unsorted extent rejection
  - end-to-end corrupted extent root returning EIO (no panic)

Signed-off-by: longjin <longjin@DragonOS.org>
2026-02-19 20:15:08 +08:00
..
src fix(ext4): propagate block I/O errors and harden extent corruption handling (#1791) 2026-02-19 20:15:08 +08:00
Cargo.lock feat(ext4): 将another_ext4库集成到内核仓库 (#1556) 2025-12-27 01:04:49 +08:00
Cargo.toml feat(ext4): 将another_ext4库集成到内核仓库 (#1556) 2025-12-27 01:04:49 +08:00