jfs: fix slab-out-of-bounds Read in dtSearch
authorManas Ghandat <ghandatmanas@gmail.com>
Wed, 25 Oct 2023 06:09:07 +0000 (11:39 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Feb 2024 20:14:15 +0000 (20:14 +0000)
commit7110650b85dd2f1cee819acd1345a9013a1a62f7
tree8850731f06804bc247b093dc225e36bc353f6f6e
parentedff092a59260bf0b0a2eba219cb3da6372c2f9f
jfs: fix slab-out-of-bounds Read in dtSearch

[ Upstream commit fa5492ee89463a7590a1449358002ff7ef63529f ]

Currently while searching for current page in the sorted entry table
of the page there is a out of bound access. Added a bound check to fix
the error.

Dave:
Set return code to -EIO

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202310241724.Ed02yUz9-lkp@intel.com/
Signed-off-by: Manas Ghandat <ghandatmanas@gmail.com>
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/jfs/jfs_dtree.c