Skip to content
Commit 4b2543f7 authored by Hagar Hemdan's avatar Hagar Hemdan Committed by Ard Biesheuvel
Browse files

efi: libstub: only free priv.runtime_map when allocated

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: f80d2604

 ("efi: libstub: avoid efi_get_memory_map() for allocating the virt map")
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarHagar Hemdan <hagarhem@amazon.com>
Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
parent cda30c65
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment