mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 19:11:53 +00:00
efi_loader: AllocateAddress requires page address
AllocatePages() can be called with Type=AllocateAddress. Such a call can only succeed if *Memory points to the address of an unallocated page range. A call with *Memory being an address that is not page aligned must not succeed. The UEFI specification requires returning EFI_OUT_OF_RESOURCES if the requested pages cannot be allocated. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
This commit is contained in:
parent
0b4cbeba59
commit
53def68df5
1 changed files with 2 additions and 0 deletions
|
@ -483,6 +483,8 @@ efi_status_t efi_allocate_pages(enum efi_allocate_type type,
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
break;
|
break;
|
||||||
case EFI_ALLOCATE_ADDRESS:
|
case EFI_ALLOCATE_ADDRESS:
|
||||||
|
if (*memory & EFI_PAGE_MASK)
|
||||||
|
return EFI_NOT_FOUND;
|
||||||
/* Exact address, reserve it. The addr is already in *memory. */
|
/* Exact address, reserve it. The addr is already in *memory. */
|
||||||
ret = efi_check_allocated(*memory, false);
|
ret = efi_check_allocated(*memory, false);
|
||||||
if (ret != EFI_SUCCESS)
|
if (ret != EFI_SUCCESS)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue