Commit d26377a7 authored by Shreyansh Chouhan's avatar Shreyansh Chouhan Committed by Zheng Zengkai
Browse files

reiserfs: check directory items on read from disk

stable inclusion
from stable-5.10.58
commit ecd8614809eb97dc48cf70c3bebeb7ddeb08c137
bugzilla: 176984 https://gitee.com/openeuler/kernel/issues/I4E2P4

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=ecd8614809eb97dc48cf70c3bebeb7ddeb08c137

--------------------------------

[ Upstream commit 13d25750 ]

While verifying the leaf item that we read from the disk, reiserfs
doesn't check the directory items, this could cause a crash when we
read a directory item from the disk that has an invalid deh_location.

This patch adds a check to the directory items read from the disk that
does a bounds check on deh_location for the directory entries. Any
directory entry header with a directory entry offset greater than the
item length is considered invalid.

Link: https://lore.kernel.org/r/20210709152929.766363-1-chouhan.shreyansh630@gmail.com


Reported-by: default avatar <syzbot+c31a48e6702ccb3d64c9@syzkaller.appspotmail.com>
Signed-off-by: default avatarShreyansh Chouhan <chouhan.shreyansh630@gmail.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Acked-by: default avatarWeilong Chen <chenweilong@huawei.com>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 0839acfc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment