]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
reiserfs: check directory items on read from disk
authorShreyansh Chouhan <chouhan.shreyansh630@gmail.com>
Fri, 9 Jul 2021 15:29:29 +0000 (20:59 +0530)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 20 Sep 2021 16:50:12 +0000 (18:50 +0200)
commit3e2613bbb27f6cbcf63d9b1d305a56c934ae5027
treed359f2e2c4f17686abe62f14e881b5f04b04ef4e
parentda608529741154175679eea96778cebe7894e6fb
reiserfs: check directory items on read from disk

BugLink: https://bugs.launchpad.net/bugs/1941798
[ Upstream commit 13d257503c0930010ef9eed78b689cec417ab741 ]

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: syzbot+c31a48e6702ccb3d64c9@syzkaller.appspotmail.com
Signed-off-by: Shreyansh Chouhan <chouhan.shreyansh630@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
fs/reiserfs/stree.c