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
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAlySdkIACgkQxIHbvCwF
 GsTLshAAjKiVtNkTpdvGk+HuWXdsKtpwLBiYtPOhbzkrxr6AdxDix4lyoaEpsAN+
 VCbdQqxhiH1TAzsE7xSCbOLZ0umGMTJe9DZE6Cjkkfb7LB3LOugkDzFLbm6NuVea
 rB9wYbtTMyKi1nBLBaIeWLb9yblddMaf2SsBSuO6lcmEnx4b0Q2JlptCIJeoP5X2
 09Uu5gIU05FDusUhfeBVovC0bxrC6isIXLTWxTGAd1tgMlpzsWW+KBI6jgNF0n5t
 /fngQCt7U+pXHsKAMkwH06/rix4+2vUzZK9q1jL5YhMCFfi8ywQHk6F0Sze+IN1r
 RQKCyS5DnmIxkoKpUzZDQJz0IWJlGxlVK57o+iXHZHKUCsP8lXiXThRPZvECw7ZD
 SEqygZapxh+kEewtJrlofj7mOTSjwXTlIkC+8PhqOB/Dmz0Anads6HmmmgGt+t3O
 ilOc9HQuJ/fp5ScgAbCbnOnrjx7kdfI+tMFaQW/DEHUsx7KirpUyuGliGbby/lmf
 5958r6KkSmNjza3H6ZuqXpV3l2Ft11JjPH61u0AXrYeqbtKf+ak8he2nF4pJfBg/
 11pbC8PXLdvfMPpzQ7/og+We8ltzoGD1gDn4uXvC9yZ7nhrHJdm8OShkXFGIUsXp
 iF2Jgu0mDcqTKDgg2K0uAtMsr761fPpPpwk5Phhm3OLSPgKEo+g=
 =3NeM
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Tom Rini 2019-03-21 13:07:42 -04:00
commit b94b19e729
7 changed files with 13 additions and 25 deletions

View File

@ -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);
}

View File

@ -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:

View File

@ -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) {

View File

@ -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);

View File

@ -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;
}

View File

@ -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 */

View File

@ -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;