sst-linux/drivers/firmware
Anton Gusev a2e6a9ff89 efi: fix potential NULL deref in efi_mem_reserve_persistent
[ Upstream commit 966d47e1f27c45507c5df82b2a2157e5a4fd3909 ]

When iterating on a linked list, a result of memremap is dereferenced
without checking it for NULL.

This patch adds a check that falls back on allocating a new page in
case memremap doesn't succeed.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 18df7577ad ("efi/memreserve: deal with memreserve entries in unmapped memory")
Signed-off-by: Anton Gusev <aagusev@ispras.ru>
[ardb: return -ENOMEM instead of breaking out of the loop]
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-02-09 11:28:11 +01:00
..
arm_ffa
arm_scmi firmware: arm_scmi: Clear stale xfer->hdr.status 2023-02-06 08:06:31 +01:00
broadcom
cirrus
efi efi: fix potential NULL deref in efi_mem_reserve_persistent 2023-02-09 11:28:11 +01:00
google firmware: coreboot: Check size of table entry and use flex-array 2023-02-01 08:34:34 +01:00
imx
meson
psci firmware/psci: Don't register with debugfs if PSCI isn't available 2023-01-18 11:58:16 +01:00
smccc
tegra
xilinx
arm_scpi.c
arm_sdei.c
dmi_scan.c
dmi-id.c
dmi-sysfs.c
edd.c
iscsi_ibft_find.c
iscsi_ibft.c
Kconfig
Makefile
memmap.c
mtk-adsp-ipc.c
pcdp.c
pcdp.h
qcom_scm-legacy.c
qcom_scm-smc.c
qcom_scm.c
qcom_scm.h
qemu_fw_cfg.c
raspberrypi.c
scpi_pm_domain.c
stratix10-rsu.c
stratix10-svc.c
sysfb_simplefb.c
sysfb.c
ti_sci.c
ti_sci.h
trusted_foundations.c
turris-mox-rwtm.c