linux-stable/drivers/nvmem
John Thomson 2278629c3e nvmem: u-boot-env: error if NVMEM device is too small
[ Upstream commit 8679e8b4a1 ]

Verify data size before trying to parse it to avoid reading out of
buffer. This could happen in case of problems at MTD level or invalid DT
bindings.

Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
Cc: stable <stable@kernel.org>
Fixes: d5542923f2 ("nvmem: add driver handling U-Boot environment variables")
[rmilecki: simplify commit description & rebase]
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240902142510.71096-2-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-09-18 19:24:04 +02:00
..
layouts
apple-efuses.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
bcm-ocotp.c
brcm_nvram.c
core.c nvmem: core: add nvmem_dev_size() helper 2024-09-18 19:24:04 +02:00
imx-iim.c
imx-ocotp-ele.c
imx-ocotp-scu.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
imx-ocotp.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
jz4780-efuse.c
Kconfig
lan9662-otpc.c
layerscape-sfp.c
lpc18xx_eeprom.c
lpc18xx_otp.c
Makefile
meson-efuse.c nvmem: meson-efuse: Fix return value of nvmem callbacks 2024-07-18 13:21:21 +02:00
meson-mx-efuse.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
microchip-otpc.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
mtk-efuse.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
mxs-ocotp.c
nintendo-otp.c
qcom-spmi-sdam.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
qfprom.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
qoriq-efuse.c
rave-sp-eeprom.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
rmem.c nvmem: rmem: Fix return value of rmem_read() 2024-07-18 13:21:21 +02:00
rockchip-efuse.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
rockchip-otp.c nvmem: rockchip-otp: set add_legacy_fixed_of_cells config option 2024-08-03 08:54:01 +02:00
sc27xx-efuse.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
sec-qfprom.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
snvs_lpgpr.c
sprd-efuse.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
stm32-bsec-optee-ta.c
stm32-bsec-optee-ta.h
stm32-romem.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
sunplus-ocotp.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
sunxi_sid.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
u-boot-env.c nvmem: u-boot-env: error if NVMEM device is too small 2024-09-18 19:24:04 +02:00
uniphier-efuse.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
vf610-ocotp.c
zynqmp_nvmem.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00