linux-stable/drivers/mtd
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
..
chips mtd: chips: Use SPDX license headers 2023-06-09 17:27:11 +02:00
devices Core MTD changes: 2023-06-28 14:02:03 -07:00
hyperbus memory: renesas-rpc-if: Remove Runtime PM wrappers 2023-01-23 11:48:00 +01:00
lpddr mtd: lpddr_cmds: remove unused words variable 2023-03-28 14:59:21 +02:00
maps mtd: maps: pismo: Switch back to use i2c_driver's .probe() 2023-06-19 10:26:03 +02:00
nand mtd: rawnand: fsl_upm: Fix an off-by one test in fun_exec_op() 2023-07-27 16:54:23 +02:00
parsers Raw NAND core changes: 2023-04-19 20:39:03 +02:00
spi-nor mtd: spi-nor: avoid holes in struct spi_mem_op 2023-07-27 16:54:22 +02:00
tests treewide: use get_random_u32_below() instead of deprecated function 2022-11-18 02:15:15 +01:00
ubi block: replace fmode_t with a block-specific type for block open flags 2023-06-12 08:04:05 -06:00
Kconfig
Makefile
ftl.c mtd: ftl: use container_of() rather than cast 2022-09-19 18:14:53 +02:00
inftlcore.c mtd: inftlcore: fix repeated words in comments 2022-11-07 17:14:21 +01:00
inftlmount.c
mtd_blkdevs.c block: replace fmode_t with a block-specific type for block open flags 2023-06-12 08:04:05 -06:00
mtdblock.c mtd: block: use a simple bool to track open for write 2023-06-12 08:04:04 -06:00
mtdblock_ro.c mtdblock: tolerate corrected bit-flips 2023-03-22 17:02:19 +01:00
mtdchar.c mtdchar: mark bits of ioctl handler noinline 2023-06-01 18:12:31 +02:00
mtdconcat.c mtd: fix repeated word in comment 2022-09-20 10:40:30 +02:00
mtdcore.c mtd: otp: clean up on error in mtd_otp_nvmem_add() 2023-06-19 10:26:06 +02:00
mtdcore.h
mtdoops.c mtd: mtdoops: panic caused mtdoops to call mtdoops_erase function immediately 2022-11-07 17:08:00 +01:00
mtdpart.c mtd: mtdpart: Drop useless LIST_HEAD 2023-06-09 17:27:14 +02:00
mtdpstore.c mtd: Fix a typo in a comment 2022-09-19 18:14:53 +02:00
mtdsuper.c
mtdswap.c mtd: always initialize 'stats' in struct mtd_oob_ops 2022-09-21 10:38:07 +02:00
nftlcore.c mtd: always initialize 'stats' in struct mtd_oob_ops 2022-09-21 10:38:07 +02:00
nftlmount.c
rfd_ftl.c
sm_ftl.c mtd: sm_ftl: Fix typos in comments 2023-06-22 23:00:43 +02:00
sm_ftl.h
ssfdc.c mtd: always initialize 'stats' in struct mtd_oob_ops 2022-09-21 10:38:07 +02:00