android_kernel_xiaomi_sm8450/fs/jfs
Zhao Mengmeng 8b1dcf25c2 jfs: Fix uninit-value access of new_ea in ea_buffer
[ Upstream commit 2b59ffad47db1c46af25ccad157bb3b25147c35c ]

syzbot reports that lzo1x_1_do_compress is using uninit-value:

=====================================================
BUG: KMSAN: uninit-value in lzo1x_1_do_compress+0x19f9/0x2510 lib/lzo/lzo1x_compress.c:178

...

Uninit was stored to memory at:
 ea_put fs/jfs/xattr.c:639 [inline]

...

Local variable ea_buf created at:
 __jfs_setxattr+0x5d/0x1ae0 fs/jfs/xattr.c:662
 __jfs_xattr_set+0xe6/0x1f0 fs/jfs/xattr.c:934

=====================================================

The reason is ea_buf->new_ea is not initialized properly.

Fix this by using memset to empty its content at the beginning
in ea_get().

Reported-by: syzbot+02341e0daa42a15ce130@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=02341e0daa42a15ce130
Signed-off-by: Zhao Mengmeng <zhaomengmeng@kylinos.cn>
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-10-17 15:08:15 +02:00
..
acl.c
file.c
inode.c jfs: prevent NULL deref in diFree 2022-04-13 21:01:03 +02:00
ioctl.c
jfs_acl.h
jfs_btree.h
jfs_debug.c
jfs_debug.h
jfs_dinode.h
jfs_discard.c jfs: Fix uaf in dbFreeBits 2024-10-17 15:08:15 +02:00
jfs_discard.h
jfs_dmap.c jfs: check if leafidx greater than num leaves per dmap tree 2024-10-17 15:08:15 +02:00
jfs_dmap.h
jfs_dtree.c jfs: fix slab-out-of-bounds Read in dtSearch 2024-02-23 08:42:04 +01:00
jfs_dtree.h
jfs_extent.c jfs: validate max amount of blocks before allocation. 2023-09-19 12:20:15 +02:00
jfs_extent.h
jfs_filsys.h jfs: jfs_dmap: Validate db_l2nbperpage while mounting 2023-07-27 08:44:27 +02:00
jfs_imap.c jfs: fix out-of-bounds in dbNextAG() and diAlloc() 2024-10-17 15:07:47 +02:00
jfs_imap.h
jfs_incore.h
jfs_inode.c
jfs_inode.h
jfs_lock.h
jfs_logmgr.c
jfs_logmgr.h
jfs_metapage.c
jfs_metapage.h
jfs_mount.c jfs: fix uaf in jfs_evict_inode 2024-02-23 08:42:04 +01:00
jfs_superblock.h
jfs_txnmgr.c FS: JFS: Check for read-only mounted filesystem in txBegin 2023-08-26 15:26:44 +02:00
jfs_txnmgr.h
jfs_types.h
jfs_umount.c
jfs_unicode.c
jfs_unicode.h
jfs_uniupr.c
jfs_xattr.h
jfs_xtree.c
jfs_xtree.h
Kconfig
Makefile
namei.c FS: JFS: Fix null-ptr-deref Read in txBegin 2023-08-26 15:26:44 +02:00
resize.c
super.c
symlink.c
xattr.c jfs: Fix uninit-value access of new_ea in ea_buffer 2024-10-17 15:08:15 +02:00