1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/mtd/nand/raw
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
..
atmel mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
bcm47xxnflash mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
brcmnand mtd: rawnand: brcmnand: Add individual glue driver selection 2022-09-21 10:38:46 +02:00
gpmi-nand mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
ingenic mtd: rawnand: ingenic: fix empty stub helper definitions 2023-05-26 19:40:32 +02:00
ams-delta.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
arasan-nand-controller.c Revert "mtd: rawnand: arasan: Prevent an unsupported configuration" 2023-06-09 17:21:08 +02:00
au1550nd.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
cadence-nand-controller.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
cafe_nand.c mtd: rawnand: cafe: Use correct function name in comment block 2022-09-21 10:38:46 +02:00
cs553x_nand.c mtd: rawnand: cs553x: simplify the return expression of cs553x_write_ctrl_byte() 2022-05-12 16:43:03 +02:00
davinci_nand.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
denali.c mtd: rawnand: Use the new ECC engine type enumeration 2020-09-28 15:59:42 +02:00
denali.h mtd: rawnand: Replace zero-length array with flexible-array member 2020-03-11 16:17:54 +01:00
denali_dt.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
denali_pci.c mtd: rawnand: denali: Use managed device resources 2022-04-21 09:34:00 +02:00
diskonchip.c SPI NOR core changes: 2020-12-16 18:48:16 +01:00
fsl_elbc_nand.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
fsl_ifc_nand.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
fsl_upm.c mtd: rawnand: fsl_upm: Fix an off-by one test in fun_exec_op() 2023-07-27 16:54:23 +02:00
fsmc_nand.c Raw NAND core changes: 2023-04-19 20:39:03 +02:00
gpio.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
hisi504_nand.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
intel-nand-controller.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
internals.h mtd: rawnand: add basic sandisk manufacturer ops 2023-06-19 10:20:55 +02:00
Kconfig mtd: rawnand: stm32_fmc2: depends on ARCH_STM32 instead of MACH_STM32MP157 2023-03-28 14:57:04 +02:00
lpc32xx_mlc.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
lpc32xx_slc.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
Makefile mtd: rawnand: add basic sandisk manufacturer ops 2023-06-19 10:20:55 +02:00
marvell_nand.c mtd: rawnand: marvell: don't set the NAND frequency select 2023-06-01 18:12:33 +02:00
meson_nand.c mtd: rawnand: meson: fix OOB available bytes for ECC 2023-07-12 13:39:47 +02:00
mpc5121_nfc.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
mtk_nand.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
mxc_nand.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
mxic_nand.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
nand_amd.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
nand_base.c mtd: rawnand: Support for sequential cache reads 2023-01-13 17:35:55 +01:00
nand_bbt.c mtd: always initialize 'stats' in struct mtd_oob_ops 2022-09-21 10:38:07 +02:00
nand_esmt.c mtd: rawnand: Use nanddev_get/set_ecc_requirements() when relevant 2020-09-28 15:59:48 +02:00
nand_hynix.c mtd: rawnand: hynix: fix up bit 0 of sdr_timing_mode 2023-03-22 17:05:51 +01:00
nand_ids.c mtd: rawnand: add support for the Sandisk SDTNQGAMA chip 2023-06-19 10:20:56 +02:00
nand_jedec.c mtd: rawnand: Check the data only read pattern only once 2023-01-13 17:35:26 +01:00
nand_legacy.c mtd: rawnand: Avoid accessing NV-DDR timings from legacy code 2021-05-26 10:43:52 +02:00
nand_macronix.c mtd: rawnand: macronix: OTP access for MX30LFxG18AC 2023-06-19 10:21:00 +02:00
nand_micron.c mtd: rawnand: Use nanddev_get/set_ecc_requirements() when relevant 2020-09-28 15:59:48 +02:00
nand_onfi.c mtd: rawnand: Check the data only read pattern only once 2023-01-13 17:35:26 +01:00
nand_samsung.c mtd: rawnand: Use nanddev_get/set_ecc_requirements() when relevant 2020-09-28 15:59:48 +02:00
nand_sandisk.c mtd: rawnand: add basic sandisk manufacturer ops 2023-06-19 10:20:55 +02:00
nand_timings.c mtd: rawnand: Add a helper to find the closest ONFI NV-DDR mode 2021-05-26 10:43:59 +02:00
nand_toshiba.c mtd: rawnand: kioxia: Add support for TH58NVG3S0HBAI4 2022-05-12 16:43:01 +02:00
nandsim.c mtd: rawnand: nandsim: Artificially prevent sequential page reads 2023-03-22 16:59:29 +01:00
ndfc.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
omap2.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
omap_elm.c mtd: rawnand: omap_elm: Fix incorrect type in assignment 2023-07-12 13:39:46 +02:00
orion_nand.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
oxnas_nand.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
pasemi_nand.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
pl35x-nand-controller.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
plat_nand.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
qcom_nandc.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
r852.c mtd: rawnand: r852: use DEVICE_ATTR_RO() helper macro 2021-06-18 09:45:21 +02:00
r852.h mtd: rawnand: r852: Move the ECC initialization to ->attach_chip() 2020-11-20 12:30:53 +01:00
renesas-nand-controller.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
rockchip-nand-controller.c mtd: rawnand: rockchip: Align hwecc vs. raw page helper layouts 2023-07-15 18:18:04 +02:00
s3c2410.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
sh_flctl.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
sharpsl.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
sm_common.c mtd: always initialize 'stats' in struct mtd_oob_ops 2022-09-21 10:38:07 +02:00
sm_common.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
socrates_nand.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
stm32_fmc2_nand.c Core MTD changes: 2023-04-25 17:23:42 -07:00
sunxi_nand.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
tegra_nand.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
txx9ndfmc.c Revert "mtd: rawnand: txx9ndfmc: Fix external use of SW Hamming ECC helper" 2021-10-15 12:21:01 +02:00
vf610_nfc.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00
xway_nand.c mtd: nand: Convert to platform remove callback returning void 2023-04-11 15:42:24 +02:00