]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ext4: fix uninitialized variable in ext4_inlinedir_to_tree
authorXiaxi Shen <shenxiaxi26@gmail.com>
Wed, 1 May 2024 03:30:17 +0000 (20:30 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Aug 2024 13:34:16 +0000 (15:34 +0200)
commit04fd4f17966c338a06f0aebaa0cf0b5e1e908946
treedca0189690790cf89d752aa3c5c1819ce4cdffed
parent208deb6d8c3cb8c3acb1f41eb31cf68ea08726d5
ext4: fix uninitialized variable in ext4_inlinedir_to_tree

[ Upstream commit 8dc9c3da79c84b13fdb135e2fb0a149a8175bffe ]

Syzbot has found an uninit-value bug in ext4_inlinedir_to_tree

This error happens because ext4_inlinedir_to_tree does not
handle the case when ext4fs_dirhash returns an error

This can be avoided by checking the return value of ext4fs_dirhash
and propagating the error,
similar to how it's done with ext4_htree_store_dirent

Signed-off-by: Xiaxi Shen <shenxiaxi26@gmail.com>
Reported-and-tested-by: syzbot+eaba5abe296837a640c0@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=eaba5abe296837a640c0
Link: https://patch.msgid.link/20240501033017.220000-1-shenxiaxi26@gmail.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ext4/inline.c