Linux EXT4 FS development
 help / color / mirror / Atom feed
* [PATCH v2 0/3] ext4: tighten mount-time superblock geometry validation
@ 2026-06-08 11:11 Baokun Li
  2026-06-08 11:11 ` [PATCH v2 1/3] ext4: reject mount if clusters/inodes per group are not 8-aligned Baokun Li
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Baokun Li @ 2026-06-08 11:11 UTC (permalink / raw)
  To: linux-ext4; +Cc: tytso, adilger.kernel, jack, yi.zhang, ojaswin, ritesh.list

Changes since v1:
 * Patch 1: Removed a spurious newline in the error message format string.
 * Added Patches 2 and 3 to fix additional issues reported by Sashiko
   (independent of Patch 1).

v1: https://patch.msgid.link/20260608061112.392391-1-libaokun@linux.alibaba.com

This series adds missing mount-time sanity checks for superblock
geometry parameters, preventing crafted filesystem images from causing
bitmap checksum corruption, integer overflow, or out-of-bounds inode
table access.

Patch 1 rejects filesystems where s_clusters_per_group or
s_inodes_per_group is not 8-aligned, since the bitmap checksum
functions operate on whole bytes and would leave trailing bits
unprotected.

Patch 2 reduces EXT4_MAX_CLUSTER_LOG_SIZE from 30 to 28 to match
the documented 256MB limit in mke2fs, preventing a 32-bit overflow
in the blocks-per-group consistency check on bigalloc filesystems.

Patch 3 rejects filesystems where s_inodes_per_group is not a
multiple of s_inodes_per_block, preventing truncation in the
s_itb_per_group calculation that could lead __ext4_get_inode_loc()
to read beyond the inode table.

Baokun Li (3):
  ext4: reject mount if clusters/inodes per group are not 8-aligned
  ext4: reduce max cluster size to match documented 256MB limit
  ext4: reject mount if inodes per group is not a multiple of inodes per
    block

 fs/ext4/ext4.h  |  2 +-
 fs/ext4/super.c | 11 +++++++----
 2 files changed, 8 insertions(+), 5 deletions(-)

-- 
2.43.7


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2026-06-09 11:04 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-08 11:11 [PATCH v2 0/3] ext4: tighten mount-time superblock geometry validation Baokun Li
2026-06-08 11:11 ` [PATCH v2 1/3] ext4: reject mount if clusters/inodes per group are not 8-aligned Baokun Li
2026-06-08 12:53   ` Zhang Yi
2026-06-09 10:57   ` Jan Kara
2026-06-08 11:11 ` [PATCH v2 2/3] ext4: reduce max cluster size to match documented 256MB limit Baokun Li
2026-06-08 18:24   ` Andreas Dilger
2026-06-09  2:48   ` Zhang Yi
2026-06-09  9:43     ` Baokun Li
2026-06-09 11:04   ` Jan Kara
2026-06-08 11:11 ` [PATCH v2 3/3] ext4: reject mount if inodes per group is not a multiple of inodes per block Baokun Li
2026-06-08 18:27   ` Andreas Dilger
2026-06-09  1:46     ` Baokun Li
2026-06-09  3:33   ` Zhang Yi
2026-06-09 11:00   ` Jan Kara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox