]> git.ipfire.org Git - thirdparty/u-boot.git/commit
efi_selftest: fix use-after-free
authorVincent Stehlé <vincent.stehle@arm.com>
Thu, 11 Jun 2026 06:59:50 +0000 (08:59 +0200)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sun, 21 Jun 2026 08:53:01 +0000 (10:53 +0200)
commit60ff3d950996c2ea0bb744fd9c922a96abc65774
treea5020bf2ca9a13da732df422a2c244a394d21ada
parent41c6b83c777788692640fa0f85a2381d8959f301
efi_selftest: fix use-after-free

When the `memory' efi selftest verifies the Devicetree memory reservation,
it accesses the memory_map buffer after it has been freed with free_pool().
Move the verification earlier to fix this.

Fixes: 34c96659ed57 ("efi_selftest: check fdt is marked as runtime data")
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
lib/efi_selftest/efi_selftest_memory.c