summaryrefslogtreecommitdiff
path: root/tools/lib/python
diff options
context:
space:
mode:
authorJiaming Zhang <r772577952@gmail.com>2026-08-31 18:54:25 +0800
committerAndreas Gruenbacher <agruenba@redhat.com>2026-09-11 15:08:22 +0200
commit33ed0a0567e0abe66ea65e89dad2e35082890fbe (patch)
treed757bd3893f9129b30a3f9305e47a02360de6881 /tools/lib/python
parent0008baad6377c8195c63151f66cc01039919eab6 (diff)
downloadlinux-next-33ed0a0567e0abe66ea65e89dad2e35082890fbe.tar.gz
linux-next-33ed0a0567e0abe66ea65e89dad2e35082890fbe.zip
gfs2: reject invalid inode sizes
A corrupted GFS2 image can store a dinode size that is larger than what VFS i_size can represent. gfs2_dinode_in() reads the on-disk di_size as a u64 and writes it directly into inode->i_size. If the value is larger than S64_MAX, the incore i_size becomes negative. That negative value can bypass the existing stuffed inode size check: inode->i_size > gfs2_max_stuffed_size(ip) Later, gfs2_quotad may try to sync the quota file and unstuff the quota inode. gfs2_unstuffer_folio() reads the negative i_size into an unsigned length and passes it to memcpy(), turning it into a huge copy size and triggering a out-of-bound issue. Reject dinodes whose size exceeds sb->s_maxbytes before storing the value in inode->i_size. Also make the stuffed inode check use the raw on-disk size while it is still unsigned. Fixes: 70376c7ff312 ("gfs2: Always check inode size of inline inodes") Closes: https://lore.kernel.org/lkml/CANypQFaF6bvORKKbRALvEL0k_epFaneFiOQqco4gjdmKVbdURg@mail.gmail.com/ Assisted-by: Codex:gpt-5.5-xhigh Cc: stable@vger.kernel.org Signed-off-by: Jiaming Zhang <r772577952@gmail.com> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions