linux-stable/drivers/firmware/efi
Hagar Hemdan b8938d6f57 efi: libstub: only free priv.runtime_map when allocated
commit 4b2543f7e1 upstream.

priv.runtime_map is only allocated when efi_novamap is not set.
Otherwise, it is an uninitialized value.  In the error path, it is freed
unconditionally.  Avoid passing an uninitialized value to free_pool.
Free priv.runtime_map only when it was allocated.

This bug was discovered and resolved using Coverity Static Analysis
Security Testing (SAST) by Synopsys, Inc.

Fixes: f80d26043a ("efi: libstub: avoid efi_get_memory_map() for allocating the virt map")
Cc: <stable@vger.kernel.org>
Signed-off-by: Hagar Hemdan <hagarhem@amazon.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-06-12 11:03:01 +02:00
..
libstub efi: libstub: only free priv.runtime_map when allocated 2024-06-12 11:03:01 +02:00
test
Kconfig efi: libstub: Remove zboot signing from build options 2022-10-21 11:09:40 +02:00
Makefile efi: vars: Remove deprecated 'efivars' sysfs interface 2022-06-24 20:40:19 +02:00
apple-properties.c efi: fix return value of __setup handlers 2022-03-01 09:02:21 +01:00
arm-runtime.c efi: runtime: Fix potential overflow of soft-reserved region size 2024-03-01 13:26:29 +01:00
capsule-loader.c efi/capsule-loader: fix incorrect allocation size 2024-03-06 14:45:09 +00:00
capsule.c
cper-arm.c
cper-x86.c
cper.c efi/cper: Reformat CPER memory error location to more readable 2022-04-08 11:36:16 +02:00
dev-path-parser.c efi/dev-path-parser: Refactor _UID handling to use acpi_dev_uid_to_integer() 2022-09-19 18:34:42 +02:00
earlycon.c
efi-bgrt.c
efi-init.c efi: Don't add memblocks for soft-reserved memory 2024-03-01 13:26:29 +01:00
efi-pstore.c efi: pstore: Omit efivars caching EFI varstore access layer 2022-06-24 20:40:19 +02:00
efi.c efi: fix panic in kdump kernel 2024-04-03 15:19:45 +02:00
efibc.c efi: efibc: Guard against allocation failure 2022-09-20 18:42:55 +02:00
embedded-firmware.c
esrt.c efi: use default_groups in kobj_type 2022-01-06 21:19:05 +01:00
fake_mem.c
fake_mem.h
fdtparams.c
memattr.c efi: Accept version 2 of memory attributes table 2023-02-09 11:28:17 +01:00
memmap.c drivers: fix typo in firmware/efi/memmap.c 2022-06-28 20:00:11 +02:00
mokvar-table.c efi/mokvar: move up init order 2022-03-08 13:55:52 +02:00
rci2-table.c
reboot.c efi: Fix efi_power_off() not being run before acpi_power_off() when necessary 2022-07-10 17:41:06 +02:00
riscv-runtime.c efi: runtime: Fix potential overflow of soft-reserved region size 2024-03-01 13:26:29 +01:00
runtime-map.c efi: use default_groups in kobj_type 2022-01-06 21:19:05 +01:00
runtime-wrappers.c arm64: efi: Recover from synchronous exceptions occurring in firmware 2023-02-01 08:34:34 +01:00
sysfb_efi.c efi: sysfb_efi: Add quirk for Lenovo Yoga Book X91F/L 2023-04-20 12:35:11 +02:00
tpm.c efi/tpm: Pass correct address to memblock_reserve 2022-10-24 08:04:25 +02:00
vars.c efi: efivars: prevent double registration 2024-03-06 14:45:17 +00:00
x86_fake_mem.c