]> git.baikalelectronics.ru Git - uboot.git/commit
efi_loader: capsule: Record capsule result only if capsule is read
authorMasami Hiramatsu <masami.hiramatsu@linaro.org>
Fri, 12 Nov 2021 13:05:15 +0000 (22:05 +0900)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 20 Nov 2021 09:53:00 +0000 (10:53 +0100)
commitd088f0b7a4ce7356a217ae38febeeff5de5d9614
tree858bc5fb0047e2042ced2e4ec9faa40542e4d246
parentb79e83bd8cd9a30d47e32b57d262af44482bb98a
efi_loader: capsule: Record capsule result only if capsule is read

Record capsule update result only if the capsule file is
successfully read, because the capsule GUID is not sure when
the file can not be read or the file is not a capsule.
Without this fix, if user puts a dummy (non-capsule) file
under (ESP)EFI/UpdateCapsule, U-Boot causes a synchronous
abort.

This also fixes use-after-free bug of the 'capsule' variable.

Fixes: cb50316984d9 ("efi_loader: capsule: add capsule_on_disk support")
Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
lib/efi_loader/efi_capsule.c