mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-09 03:21:51 +00:00
efi_loader: check memory type in AllocatePages()
The UEFI specification prescribes that AllocatePages() checks the memory type. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
parent
6182495e10
commit
f12bcc9149
2 changed files with 8 additions and 0 deletions
|
@ -376,6 +376,10 @@ efi_status_t efi_allocate_pages(int type, int memory_type,
|
|||
efi_status_t r = EFI_SUCCESS;
|
||||
uint64_t addr;
|
||||
|
||||
/* Check import parameters */
|
||||
if (memory_type >= EFI_PERSISTENT_MEMORY_TYPE &&
|
||||
memory_type <= 0x6FFFFFFF)
|
||||
return EFI_INVALID_PARAMETER;
|
||||
if (!memory)
|
||||
return EFI_INVALID_PARAMETER;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue