diff options
| author | Tom Rini <[email protected]> | 2024-09-19 11:25:26 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2024-09-19 11:25:26 -0600 |
| commit | 2ac0a302ada6b1d0d9a2a137fd790ccd4f8d2090 (patch) | |
| tree | dc529cd1f3c14da2c028833bb501a4a6ddf1d9f1 /lib/efi_loader | |
| parent | c17805e19b9335e1fb5295c81b59eddf88d1b9ec (diff) | |
| parent | 6f933aa963bb971d848ff6bd1c743035bbc98ead (diff) | |
Merge tag 'fwu-next-19092024' of https://source.denx.de/u-boot/custodians/u-boot-tpm into next
This PR contains various improvements in the A/B update logic for EFI
- Read both copies of metadata, in case one of the is corrupted
- Check the metadata version against the running firmware to make sure it's
allowed
- Limit the use of a revert capsule if the board is on a trial state and
make sure it's not applied if the max counter has expired
Diffstat (limited to 'lib/efi_loader')
| -rw-r--r-- | lib/efi_loader/efi_capsule.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c index a4ea2873038..f8a4a7c6ef4 100644 --- a/lib/efi_loader/efi_capsule.c +++ b/lib/efi_loader/efi_capsule.c @@ -564,9 +564,14 @@ static efi_status_t efi_capsule_update_firmware( bool fw_accept_os; if (IS_ENABLED(CONFIG_FWU_MULTI_BANK_UPDATE)) { - if (fwu_empty_capsule_checks_pass() && - fwu_empty_capsule(capsule_data)) - return fwu_empty_capsule_process(capsule_data); + if (fwu_empty_capsule(capsule_data)) { + if (fwu_empty_capsule_checks_pass()) { + return fwu_empty_capsule_process(capsule_data); + } else { + log_err("FWU empty capsule checks failed. Cannot start update\n"); + return EFI_INVALID_PARAMETER; + } + } if (!fwu_update_checks_pass()) { log_err("FWU checks failed. Cannot start update\n"); |
