diff options
| author | Tom Rini <[email protected]> | 2025-11-15 08:05:45 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-11-15 08:05:45 -0600 |
| commit | 69cc92d6869b8ff4591e5b8850872da34934bab9 (patch) | |
| tree | abf7002e0dc3cb7bc9721d5dded3af86b18b0f72 /lib/efi_loader | |
| parent | 55d60ef1c91b309ba8b1c360031b13e5b3d4b31a (diff) | |
| parent | 8cc144227e13b50cd6d97c36ebb45f31f4d8c9cd (diff) | |
Merge tag 'efi-2026-01-rc3' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request efi-2026-01-rc3
CI:
* https://source.denx.de/u-boot/custodians/u-boot-efi/-/pipelines/28355
Documentation:
* Correct the linux/arm64 platform string for Docker builds
* Complete pytest dependencies list with missing packages
UEFI:
* Use Sphinx style comments in efi_selftest_console.c
* Don't include asm/global_data.h in lib/efi_client/efi_app.c twice
* efi_client: correct memset() return value
* Assure fitImage from capsule is used from 8-byte aligned address
* Fix warning when building efi_selftest_snp with clang
Diffstat (limited to 'lib/efi_loader')
| -rw-r--r-- | lib/efi_loader/efi_firmware.c | 16 | ||||
| -rw-r--r-- | lib/efi_loader/efi_ipconfig.c | 4 |
2 files changed, 17 insertions, 3 deletions
diff --git a/lib/efi_loader/efi_firmware.c b/lib/efi_loader/efi_firmware.c index 216df83de67..b41969c70fd 100644 --- a/lib/efi_loader/efi_firmware.c +++ b/lib/efi_loader/efi_firmware.c @@ -651,6 +651,7 @@ efi_status_t EFIAPI efi_firmware_fit_set_image( efi_status_t status; struct fmp_state state = { 0 }; char *orig_dfu_env; + void *img; EFI_ENTRY("%p %d %p %zu %p %p %p\n", this, image_index, image, image_size, vendor_code, progress, abort_reason); @@ -677,7 +678,20 @@ efi_status_t EFIAPI efi_firmware_fit_set_image( return EFI_EXIT(EFI_DEVICE_ERROR); } - ret = fit_update(image); + /* Make sure the update fitImage is properly aligned to 8-bytes */ + if (!IS_ALIGNED((uintptr_t)image, 8)) { + img = memalign(8, image_size); + if (!img) + return EFI_EXIT(EFI_BAD_BUFFER_SIZE); + memcpy(img, image, image_size); + } else { + img = (void *)image; + } + + ret = fit_update(img); + + if (!IS_ALIGNED((uintptr_t)image, 8)) + free(img); if (env_set("dfu_alt_info", orig_dfu_env)) log_warning("Unable to restore env variable \"dfu_alt_info\". Further DFU operations may fail!\n"); diff --git a/lib/efi_loader/efi_ipconfig.c b/lib/efi_loader/efi_ipconfig.c index 9f51f77fa9a..b20de8c3e4b 100644 --- a/lib/efi_loader/efi_ipconfig.c +++ b/lib/efi_loader/efi_ipconfig.c @@ -168,8 +168,8 @@ static efi_status_t EFIAPI efi_ip4_config2_register_notify(struct efi_ip4_config } /* - * efi_ip4_config2_unregister_notify() - Remove a previously registered eventfor - * the specified configuration data + * efi_ip4_config2_unregister_notify() - Remove a previously registered event + * for the specified configuration data * * This function implements EFI_IP4_CONFIG2_PROTOCOL.UnregisterDataNotify() * See the Unified Extensible Firmware Interface |
