On Tue, 06 May 2025 09:20:06 +0800, Zhang Yi wrote: > Punching a hole with a start offset that exceeds max_end is not > permitted and will result in a negative length in the > truncate_inode_partial_folio() function while truncating the page cache, > potentially leading to undesirable consequences. > > A simple reproducer: > > [...] Applied, thanks! [1/4] ext4: fix out of bounds punch offset commit: b5e58bcd79625423487fa3ecba8e8411b5396327 [2/4] ext4: fix incorrect punch max_end commit: 29ec9bed2395061350249ae356fb300dd82a78e7 [3/4] ext4: factor out ext4_get_maxbytes() commit: dbe27f06fa38b9bfc598f8864ae1c5d5831d9992 [4/4] ext4: ensure i_size is smaller than maxbytes commit: 1a77a028a392fab66dd637cdfac3f888450d00af Best regards, -- Theodore Ts'o <tytso@xxxxxxx>