diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2023-07-20 00:55:01 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-08-11 13:08:25 +0300 |
commit | f4b700c71802c81e6f9dce362ee7a0312c8377ba (patch) | |
tree | c0e4ce9c598e0996ea6c52a4c80cae52982261cb /arch/powerpc/mm/init_64.c | |
parent | b71c00256da4e1d2f7f9bed31038a152bc40dbf9 (diff) | |
download | linux-f4b700c71802c81e6f9dce362ee7a0312c8377ba.tar.xz |
mtd: rawnand: fsl_upm: Fix an off-by one test in fun_exec_op()
[ Upstream commit c6abce60338aa2080973cd95be0aedad528bb41f ]
'op-cs' is copied in 'fun->mchip_number' which is used to access the
'mchip_offsets' and the 'rnb_gpio' arrays.
These arrays have NAND_MAX_CHIPS elements, so the index must be below this
limit.
Fix the sanity check in order to avoid the NAND_MAX_CHIPS value. This
would lead to out-of-bound accesses.
Fixes: 54309d657767 ("mtd: rawnand: fsl_upm: Implement exec_op()")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/cd01cba1c7eda58bdabaae174c78c067325803d2.1689803636.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch/powerpc/mm/init_64.c')
0 files changed, 0 insertions, 0 deletions