linux-stable/drivers/mtd/nand
Christophe JAILLET c6abce6033 mtd: rawnand: fsl_upm: Fix an off-by one test in fun_exec_op()
'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: 54309d6577 ("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
2023-07-27 16:54:23 +02:00
..
onenand mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
raw mtd: rawnand: fsl_upm: Fix an off-by one test in fun_exec_op() 2023-07-27 16:54:23 +02:00
spi mtd: spinand: winbond: Fix ecc_get_status 2023-07-12 13:39:44 +02:00
Kconfig mtd: nand: MTD_NAND_ECC_MEDIATEK should depend on ARCH_MEDIATEK 2022-05-12 16:43:04 +02:00
Makefile mtd: nand: make mtk_ecc.c a separated module 2022-04-27 18:12:35 +02:00
bbt.c mtd: nand: bbt: Use the bitmap API to allocate bitmaps 2022-09-20 10:06:58 +02:00
core.c mtd: nand: drop EXPORT_SYMBOL_GPL for nanddev_erase() 2022-11-07 17:17:20 +01:00
ecc-mtk.c mtd: nand: ecc-mtk: Add ECC support fot MT7986 IC 2023-02-03 19:09:44 +01:00
ecc-mxic.c Core MTD changes: 2023-04-25 17:23:42 -07:00
ecc-sw-bch.c mtd: nand: ecc-bch: Use the public nsteps field 2021-03-11 09:37:28 +01:00
ecc-sw-hamming.c mtd: rawnand: Let callers use the bare Hamming helpers 2021-10-15 12:20:59 +02:00
ecc.c mtd: nand: ecc: Provide a helper to retrieve a pilelined engine device 2022-02-09 09:49:36 +01:00