Skip to content

fs: ext4: protection against corrupted filesystems

Sascha Hauer barebox 1 version Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am 20260402-fs-ext4-buffer-overflows-v1-0-b9f8a909fe58@pengutronix.de change-id 20260402-fs-ext4-buffer-overflows-b26d5463cb7c

Versions newest first

  1. v1 Latest5 patches 4 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/5fs: ext4: validate log2_block_size from superblock at mountfs/ext4/ext4_common.c+8 -01 reply
2/5fs: ext4: reject superblocks with zero inodesz, gdsize or inodes_per_groupfs/ext4/ext4_common.c+9 -01 reply
3/5fs: ext4: fix OOB read and infinite loop in ext_iterate()fs/ext4/ext_barebox.c+8 -31 reply
4/5fs: ext4: reject dirents with too-small direntlen to prevent infinite loopsfs/ext4/ext4_common.c fs/ext4/ext_barebox.c+4 -00 replies
5/5fs: ext4: validate extent eh_entries against buffer capacityfs/ext4/ext4_common.c+32 -00 replies

Reviews trailers per patch

2 of 5 patches have a Reviewed-by or Acked-by.

PatchClaude Opus 4.6 (1M context)Ahmad Fatoum
1/5Co-Authored-By R-b
2/5Co-Authored-By R-b
3/5Co-Authored-By
4/5Co-Authored-By
5/5Co-Authored-By

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/5] fs: ext4: protection against corrupted filesystems

This series contains fixes against corrupted filesystems leading to buffer overflows or division-by-zero. All patches have been tested to be effective with manipulated fs images.

---
Sascha Hauer (5):
fs: ext4: validate log2_block_size from superblock at mount
fs: ext4: reject superblocks with zero inodesz, gdsize or inodes_per_group
fs: ext4: fix OOB read and infinite loop in ext_iterate()
fs: ext4: reject dirents with too-small direntlen to prevent infinite loops
fs: ext4: validate extent eh_entries against buffer capacity

 fs/ext4/ext4_common.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 fs/ext4/ext_barebox.c | 13 ++++++++++---
 2 files changed, 61 insertions(+), 3 deletions(-)

---
base-commit: 0933e8f2ebf0d91dfcf177a4e4292b02921a53f1
change-id: 20260402-fs-ext4-buffer-overflows-b26d5463cb7c

Best regards,

Signature · 1 line
Sascha Hauer <[email protected]>