]> git.dujemihanovic.xyz Git - u-boot.git/commit
efi_loader: improve error handling in try_load_entry()
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Mon, 22 Apr 2024 08:41:00 +0000 (10:41 +0200)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Wed, 1 May 2024 05:38:29 +0000 (07:38 +0200)
commit566f067349a8f6136cf62d907019efdf1e250ce5
tree7d5ab6ecdfed4757638c97aa46bbf1a3aea1a505
parent84aab11d3503a555ca6349da76efa4f4aedfc136
efi_loader: improve error handling in try_load_entry()

The image is not unloaded if a security violation occurs.

If efi_set_load_options() fails, we do not free the memory allocated for
the optional data. We do not unload the image.

* Unload the image if a security violation occurs.
* Free load_options if efi_set_load_options() fails.
* Unload the image if efi_set_load_options() fails.

Fixes: 53f6a5aa8626 ("efi_loader: Replace config option for initrd loading")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
lib/efi_loader/efi_bootmgr.c
test/py/tests/test_efi_secboot/test_signed.py
test/py/tests/test_efi_secboot/test_signed_intca.py
test/py/tests/test_efi_secboot/test_unsigned.py