]> git.baikalelectronics.ru Git - kernel.git/commit
gfs2: Always check inode size of inline inodes
authorAndreas Gruenbacher <agruenba@redhat.com>
Sun, 4 Dec 2022 16:00:04 +0000 (17:00 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Feb 2023 10:28:27 +0000 (11:28 +0100)
commit19fb6359a5e0c52b4d58421102208f71d60187d4
treefa1a67061ba66d4b60df9da69ca35822792b3ce6
parent12db7985e95ba6f0b9a489f5cb1176373e348102
gfs2: Always check inode size of inline inodes

commit 70376c7ff31221f1d21db5611d8209e677781d3a upstream.

Check if the inode size of stuffed (inline) inodes is within the allowed
range when reading inodes from disk (gfs2_dinode_in()).  This prevents
us from on-disk corruption.

The two checks in stuffed_readpage() and gfs2_unstuffer_page() that just
truncate inline data to the maximum allowed size don't actually make
sense, and they can be removed now as well.

Reported-by: syzbot+7bb81dfa9cda07d9cd9d@syzkaller.appspotmail.com
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/gfs2/aops.c
fs/gfs2/bmap.c
fs/gfs2/glops.c