summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-04-18 08:47:27 -0400
committerTom Rini <trini@konsulko.com>2021-04-18 08:47:27 -0400
commit3a9aaefcaa3efc2a1cef86fbe0bf229a1bff9902 (patch)
tree2416f97d2f91e66e38bd5dd7f9217092e9332b49
parentc6ae5e9869cf7a9fbf1c9cec5aaa3fd5b8def670 (diff)
parentb1a7a5e0b8822a0868ee9318d8d3fa9645efc12d (diff)
downloadu-boot-WIP/18Apr2021.tar.gz
Merge tag 'efi-2021-07-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot-efiWIP/18Apr2021
Pull request for efi-2021-07-rc1-2 Documentation: man-page for fatinfo Bug fixes: memory leak in efi_capsule_scan_dir() incorrect invocations of EFI_CALL macro creating ESRT table buffer overflow in tcg2_create_digest()
-rw-r--r--doc/board/toradex/apalix-imx8x.rst2
-rw-r--r--doc/chromium/overview.rst6
-rw-r--r--doc/imx/misc/psb.rst2
-rw-r--r--doc/usage/index.rst1
-rw-r--r--lib/efi_loader/efi_capsule.c3
-rw-r--r--lib/efi_loader/efi_esrt.c28
-rw-r--r--lib/efi_loader/efi_tcg2.c2
7 files changed, 24 insertions, 20 deletions
diff --git a/doc/board/toradex/apalix-imx8x.rst b/doc/board/toradex/apalix-imx8x.rst
index efa7e0c72e..e62578b152 100644
--- a/doc/board/toradex/apalix-imx8x.rst
+++ b/doc/board/toradex/apalix-imx8x.rst
@@ -1,7 +1,7 @@
.. SPDX-License-Identifier: GPL-2.0+
Apalis iMX8X V1.1A Module (SoC NXP i.MX8QXP RevB)
-==========================
+=================================================
Quick Start
-----------
diff --git a/doc/chromium/overview.rst b/doc/chromium/overview.rst
index 5498ed9c16..790233cb66 100644
--- a/doc/chromium/overview.rst
+++ b/doc/chromium/overview.rst
@@ -45,7 +45,7 @@ Here is some material relevant to Chromium OS verified boot with U-Boot:
- Presented at Open Source Firmware Conference 2018, Erlangen
- Describes the work in progress as at the end of 2018
- Slides at `OSFC <https://2018.osfc.io/uploads/talk/paper/26/U-Boot_with_Chrome_OS_and_firmware_packaging.pdf>`_
- - Video on `Youtube <https://www.youtube.com/watch?v=1jknxUvmwpo>`_
+ - `Youtube video 'OSFC - U-Boot with Chrome OS and firmware packaging' <https://www.youtube.com/watch?v=1jknxUvmwpo>`_
- "Verified Boot in Chrome OS and how to make it work for you"
@@ -58,7 +58,7 @@ Here is some material relevant to Chromium OS verified boot with U-Boot:
and pit/pi (`Samsung Chromebook 2 <https://www.cnet.com/products/samsung-chromebook-2-xe503c12-11-6-exynos-5-octa-4-gb-ram-16-gb-ssd/>`_
with Exynos 5 Octa 5420 in 2014).
- Slides at `Google research <https://research.google/pubs/pub42038/>`_
- - Video at `Youtube <https://www.youtube.com/watch?v=kdpZC9jFzZA>`_
+ - `Youtube video 'Verified Boot on Chrome OS and How to do it yourself' <https://www.youtube.com/watch?v=kdpZC9jFzZA>`_
- "Chrome University 2018: Chrome OS Firmware and Verified Boot 201"
@@ -67,7 +67,7 @@ Here is some material relevant to Chromium OS verified boot with U-Boot:
topics. This has no U-Boot information, but does cover coreboot and also
talks about the Chrome OS EC and Security chip. This is probably the
best introduction talk.
- - Video at `YouTube <https://www.youtube.com/watch?v=WY2sWpuda2g>`_
+ - `Youtube video 'Chrome University 2018: Chrome OS Firmware and Verified Boot 201' <https://www.youtube.com/watch?v=WY2sWpuda2g>`_
- `Chromium OS U-Boot <https://www.chromium.org/developers/u-boot>`_
diff --git a/doc/imx/misc/psb.rst b/doc/imx/misc/psb.rst
index 4d6f001b74..9bb84b4024 100644
--- a/doc/imx/misc/psb.rst
+++ b/doc/imx/misc/psb.rst
@@ -88,7 +88,7 @@ SIT format
SIT is a 20 byte long structure containing of 5 32-bit words. Those encode
bootloader B-copy area offset (called "firstSectorNumber"), magic value
(called "tag") that is always 0x00112233, and three unused words set to 0.
-SIT is documented in [1] and [2]. Example SIT are below::
+SIT is documented in [1]_ and [2]_. Example SIT are below::
$ hexdump -vC sit-mx7d.bin
00000000 00 00 00 00
diff --git a/doc/usage/index.rst b/doc/usage/index.rst
index d330b14a17..b64cfe444a 100644
--- a/doc/usage/index.rst
+++ b/doc/usage/index.rst
@@ -28,6 +28,7 @@ Shell commands
exception
exit
false
+ fatinfo
for
load
loady
diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c
index 9df9c35084..691eda5e0d 100644
--- a/lib/efi_loader/efi_capsule.c
+++ b/lib/efi_loader/efi_capsule.c
@@ -756,8 +756,11 @@ static efi_status_t efi_capsule_scan_dir(u16 ***files, unsigned int *num)
tmp_size = dirent_size;
ret = EFI_CALL((*dirh->read)(dirh, &tmp_size, dirent));
if (ret == EFI_BUFFER_TOO_SMALL) {
+ struct efi_file_info *old_dirent = dirent;
+
dirent = realloc(dirent, tmp_size);
if (!dirent) {
+ dirent = old_dirent;
ret = EFI_OUT_OF_RESOURCES;
goto err;
}
diff --git a/lib/efi_loader/efi_esrt.c b/lib/efi_loader/efi_esrt.c
index 40f53260e4..3ca55ce23a 100644
--- a/lib/efi_loader/efi_esrt.c
+++ b/lib/efi_loader/efi_esrt.c
@@ -139,7 +139,7 @@ efi_status_t efi_esrt_allocate_install(u32 num_entries)
/* If there was a previous ESRT, deallocate its memory now. */
if (esrt)
- ret = EFI_CALL(efi_free_pool(esrt));
+ ret = efi_free_pool(esrt);
esrt = new_esrt;
@@ -253,8 +253,8 @@ efi_status_t efi_esrt_add_from_fmp(struct efi_firmware_management_protocol *fmp)
return EFI_INVALID_PARAMETER;
}
- ret = EFI_CALL(efi_allocate_pool(EFI_BOOT_SERVICES_DATA, info_size,
- (void **)&img_info));
+ ret = efi_allocate_pool(EFI_BOOT_SERVICES_DATA, info_size,
+ (void **)&img_info);
if (ret != EFI_SUCCESS) {
EFI_PRINT("ESRT failed to allocate memory for image info.\n");
return ret;
@@ -298,7 +298,7 @@ efi_status_t efi_esrt_add_from_fmp(struct efi_firmware_management_protocol *fmp)
}
out:
- EFI_CALL(efi_free_pool(img_info));
+ efi_free_pool(img_info);
return EFI_SUCCESS;
}
@@ -384,8 +384,8 @@ efi_status_t efi_esrt_populate(void)
goto out;
}
- ret = EFI_CALL(efi_allocate_pool(EFI_BOOT_SERVICES_DATA, info_size,
- (void **)&img_info));
+ ret = efi_allocate_pool(EFI_BOOT_SERVICES_DATA, info_size,
+ (void **)&img_info);
if (ret != EFI_SUCCESS) {
EFI_PRINT("ESRT failed to allocate memory for image info\n");
goto out;
@@ -405,13 +405,13 @@ efi_status_t efi_esrt_populate(void)
if (ret != EFI_SUCCESS) {
EFI_PRINT("ESRT failed to obtain image info from FMP\n");
- EFI_CALL(efi_free_pool(img_info));
+ efi_free_pool(img_info);
goto out;
}
num_entries += desc_count;
- EFI_CALL(efi_free_pool(img_info));
+ efi_free_pool(img_info);
}
EFI_PRINT("ESRT create table with %u entries\n", num_entries);
@@ -430,9 +430,9 @@ efi_status_t efi_esrt_populate(void)
*/
it_handle = base_handle;
for (u32 idx = 0; idx < no_handles; idx++, it_handle++) {
- ret = EFI_CALL(efi_search_protocol(*it_handle,
- &efi_guid_firmware_management_protocol,
- &handler));
+ ret = efi_search_protocol(*it_handle,
+ &efi_guid_firmware_management_protocol,
+ &handler);
if (ret != EFI_SUCCESS) {
EFI_PRINT("ESRT unable to find FMP handle (%u)\n",
@@ -448,7 +448,7 @@ efi_status_t efi_esrt_populate(void)
out:
- EFI_CALL(efi_free_pool(base_handle));
+ efi_free_pool(base_handle);
return ret;
}
@@ -490,8 +490,8 @@ efi_status_t efi_esrt_register(void)
return ret;
}
- ret = EFI_CALL(efi_create_event(EVT_NOTIFY_SIGNAL, TPL_CALLBACK,
- efi_esrt_new_fmp_notify, NULL, NULL, &ev));
+ ret = efi_create_event(EVT_NOTIFY_SIGNAL, TPL_CALLBACK,
+ efi_esrt_new_fmp_notify, NULL, NULL, &ev);
if (ret != EFI_SUCCESS) {
EFI_PRINT("ESRT failed to create event\n");
return ret;
diff --git a/lib/efi_loader/efi_tcg2.c b/lib/efi_loader/efi_tcg2.c
index ed86a220fb..d5eca68769 100644
--- a/lib/efi_loader/efi_tcg2.c
+++ b/lib/efi_loader/efi_tcg2.c
@@ -515,7 +515,7 @@ static efi_status_t tcg2_create_digest(const u8 *input, u32 length,
sha1_context ctx;
sha256_context ctx_256;
sha512_context ctx_512;
- u8 final[TPM2_ALG_SHA512];
+ u8 final[TPM2_SHA512_DIGEST_SIZE];
efi_status_t ret;
u32 active;
int i;