diff options
author | Tom Rini | 2019-03-21 13:07:42 -0400 |
---|---|---|
committer | Tom Rini | 2019-03-21 13:07:42 -0400 |
commit | b94b19e729895285cd0c9ed170d20038173d4f07 (patch) | |
tree | eaa8af4493f2ef06e58bd5ce6a6e50d64a8f0e29 | |
parent | 3d7891d3f3b67a0d150b38afccc0765bd19b0bd2 (diff) | |
parent | d0bd87612f410a723d5ddb3001e805485e3efb4f (diff) |
Merge tag 'efi-2019-04-rc5' of git://git.denx.de/u-boot-efi
Pull request for UEFI system for v2019.04-rc5
A bunch of small fixes. The major ones being
- avoid illegal memory access in efi_allocate_pool() on 32 bit systems
- avoid endless loop in HII protocol
-rw-r--r-- | cmd/nvedit_efi.c | 1 | ||||
-rw-r--r-- | lib/efi_loader/efi_boottime.c | 6 | ||||
-rw-r--r-- | lib/efi_loader/efi_file.c | 2 | ||||
-rw-r--r-- | lib/efi_loader/efi_hii.c | 5 | ||||
-rw-r--r-- | lib/efi_loader/efi_memory.c | 5 | ||||
-rw-r--r-- | lib/efi_loader/efi_variable.c | 2 | ||||
-rw-r--r-- | lib/efi_selftest/efi_selftest_hii.c | 17 |
7 files changed, 13 insertions, 25 deletions
diff --git a/cmd/nvedit_efi.c b/cmd/nvedit_efi.c index ca32566a615..e65b38dbf39 100644 --- a/cmd/nvedit_efi.c +++ b/cmd/nvedit_efi.c @@ -80,7 +80,6 @@ static void efi_dump_single_var(u16 *name, efi_guid_t *guid) printf(", DataSize = 0x%zx\n", size); print_hex_dump(" ", DUMP_PREFIX_OFFSET, 16, 1, data, size, true); - return; out: free(data); } diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index bd8b8a17ae7..4fc550d9f37 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -1581,10 +1581,8 @@ efi_status_t efi_setup_loaded_image(struct efi_device_path *device_path, goto failure; #endif - if (info_ptr) - *info_ptr = info; - if (handle_ptr) - *handle_ptr = obj; + *info_ptr = info; + *handle_ptr = obj; return ret; failure: diff --git a/lib/efi_loader/efi_file.c b/lib/efi_loader/efi_file.c index 3a7323765bd..bc715218a1b 100644 --- a/lib/efi_loader/efi_file.c +++ b/lib/efi_loader/efi_file.c @@ -226,7 +226,7 @@ static efi_status_t EFIAPI efi_file_open(struct efi_file_handle *file, efi_status_t ret; EFI_ENTRY("%p, %p, \"%ls\", %llx, %llu", file, new_handle, - (wchar_t *)file_name, open_mode, attributes); + file_name, open_mode, attributes); /* Check parameters */ if (!file || !new_handle || !file_name) { diff --git a/lib/efi_loader/efi_hii.c b/lib/efi_loader/efi_hii.c index 3a966fa4dff..61b71dec621 100644 --- a/lib/efi_loader/efi_hii.c +++ b/lib/efi_loader/efi_hii.c @@ -227,9 +227,8 @@ out: error: if (stbl) { free(stbl->language); - if (idx > 0) - while (--idx >= 0) - free(stbl->strings[idx].string); + while (idx > 0) + free(stbl->strings[--idx].string); free(stbl->strings); } free(stbl); diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c index ebd2b36c03d..55622d2fb40 100644 --- a/lib/efi_loader/efi_memory.c +++ b/lib/efi_loader/efi_memory.c @@ -440,6 +440,7 @@ efi_status_t efi_free_pages(uint64_t memory, efi_uintn_t pages) efi_status_t efi_allocate_pool(int pool_type, efi_uintn_t size, void **buffer) { efi_status_t r; + u64 addr; struct efi_pool_allocation *alloc; u64 num_pages = efi_size_in_pages(size + sizeof(struct efi_pool_allocation)); @@ -453,9 +454,9 @@ efi_status_t efi_allocate_pool(int pool_type, efi_uintn_t size, void **buffer) } r = efi_allocate_pages(EFI_ALLOCATE_ANY_PAGES, pool_type, num_pages, - (uint64_t *)&alloc); - + &addr); if (r == EFI_SUCCESS) { + alloc = (struct efi_pool_allocation *)(uintptr_t)addr; alloc->num_pages = num_pages; *buffer = alloc->data; } diff --git a/lib/efi_loader/efi_variable.c b/lib/efi_loader/efi_variable.c index e0d7f5736db..699f4184d93 100644 --- a/lib/efi_loader/efi_variable.c +++ b/lib/efi_loader/efi_variable.c @@ -335,7 +335,7 @@ efi_status_t EFIAPI efi_get_next_variable_name(efi_uintn_t *variable_name_size, EFI_ENTRY("%p \"%ls\" %pUl", variable_name_size, variable_name, vendor); if (!variable_name_size || !variable_name || !vendor) - EFI_EXIT(EFI_INVALID_PARAMETER); + return EFI_EXIT(EFI_INVALID_PARAMETER); if (variable_name[0]) { /* check null-terminated string */ diff --git a/lib/efi_selftest/efi_selftest_hii.c b/lib/efi_selftest/efi_selftest_hii.c index 8a0b3bc3536..f4b70f79508 100644 --- a/lib/efi_selftest/efi_selftest_hii.c +++ b/lib/efi_selftest/efi_selftest_hii.c @@ -783,19 +783,10 @@ static int test_hii_string_get_string(void) goto out; } -#if 1 - u16 *c1, *c2; - - for (c1 = string, c2 = L"Japanese"; *c1 == *c2; c1++, c2++) - ; - if (!*c1 && !*c2) - result = EFI_ST_SUCCESS; - else - result = EFI_ST_FAILURE; -#else - /* TODO: %ls */ - efi_st_printf("got string is %s (can be wrong)\n", string); -#endif + if (efi_st_strcmp_16_8(string, "Japanese")) { + efi_st_error("get_string returned incorrect string\n"); + goto out; + } result = EFI_ST_SUCCESS; |