linux-stable/fs/gfs2
Andreas Gruenbacher 4d4cb76636 gfs2: Always check inode size of inline inodes
commit 70376c7ff3 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>
[pchelkin@ispras.ru: adjust the inode variable inside gfs2_dinode_in with
the format used before upstream commit 7db354444a ("gfs2: Cosmetic
gfs2_dinode_{in,out} cleanup")]
Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-04-05 11:16:46 +02:00
..
acl.c
acl.h
aops.c gfs2: Always check inode size of inline inodes 2023-04-05 11:16:46 +02:00
aops.h
bmap.c gfs2: Always check inode size of inline inodes 2023-04-05 11:16:46 +02:00
bmap.h
dentry.c
dir.c
dir.h
export.c
file.c gfs2: Prevent direct-I/O write fallback errors from getting lost 2021-06-18 09:58:58 +02:00
gfs2.h
glock.c gfs2: Fix use-after-free in gfs2_glock_shrink_scan 2021-06-18 09:58:59 +02:00
glock.h
glops.c gfs2: Always check inode size of inline inodes 2023-04-05 11:16:46 +02:00
glops.h
incore.h gfs2: use-after-free in sysfs deregistration 2020-11-05 11:43:21 +01:00
inode.c gfs2: clean up iopen glock mess in gfs2_create_inode 2020-10-01 13:17:20 +02:00
inode.h
Kconfig
lock_dlm.c gfs2: Don't call dlm after protocol is unmounted 2021-09-22 12:26:33 +02:00
log.c gfs2: initialize transaction tr_ailX_lists earlier 2020-09-23 12:40:33 +02:00
log.h gfs2: Do log_flush in gfs2_ail_empty_gl even if ail list is empty 2020-04-17 10:50:03 +02:00
lops.c gfs2: Even more gfs2_find_jhead fixes 2020-06-17 16:40:21 +02:00
lops.h
main.c
Makefile
meta_io.c
meta_io.h
ops_fstype.c gfs2: Switch from strlcpy to strscpy 2022-11-25 17:42:22 +01:00
quota.c gfs2: move privileged user check to gfs2_quota_lock_check 2020-06-03 08:21:09 +02:00
quota.h gfs2: move privileged user check to gfs2_quota_lock_check 2020-06-03 08:21:09 +02:00
recovery.c
recovery.h
rgrp.c gfs2: assign rgrp glock before compute_bitstructs 2022-04-27 13:50:45 +02:00
rgrp.h
super.c gfs2: report "already frozen/thawed" errors 2021-04-16 11:46:37 +02:00
super.h
sys.c gfs2: use-after-free in sysfs deregistration 2020-11-05 11:43:21 +01:00
sys.h
trace_gfs2.h
trans.c gfs2: initialize transaction tr_ailX_lists earlier 2020-09-23 12:40:33 +02:00
trans.h
util.c
util.h
xattr.c
xattr.h