kernel_samsung_a53x/fs/jfs
Juntong Deng 6658ebe102 fs/jfs: Add validity check for db_maxag and db_agpref
[ Upstream commit 64933ab7b04881c6c18b21ff206c12278341c72e ]

Both db_maxag and db_agpref are used as the index of the
db_agfree array, but there is currently no validity check for
db_maxag and db_agpref, which can lead to errors.

The following is related bug reported by Syzbot:

UBSAN: array-index-out-of-bounds in fs/jfs/jfs_dmap.c:639:20
index 7936 is out of range for type 'atomic_t[128]'

Add checking that the values of db_maxag and db_agpref are valid
indexes for the db_agfree array.

Reported-by: syzbot+38e876a8aa44b7115c76@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=38e876a8aa44b7115c76
Signed-off-by: Juntong Deng <juntong.deng@outlook.com>
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-18 11:43:13 +01:00
..
acl.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
file.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
inode.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ioctl.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_acl.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_btree.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_debug.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_debug.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_dinode.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_discard.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_discard.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_dmap.c fs/jfs: Add validity check for db_maxag and db_agpref 2024-11-18 11:43:13 +01:00
jfs_dmap.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_dtree.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_dtree.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_extent.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_extent.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_filsys.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_imap.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_imap.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_incore.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_inode.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_inode.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_lock.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_logmgr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_logmgr.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_metapage.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_metapage.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_mount.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_superblock.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_txnmgr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_txnmgr.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_types.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_umount.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_unicode.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_unicode.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_uniupr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_xattr.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_xtree.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jfs_xtree.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
namei.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
resize.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
super.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
symlink.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xattr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00