Commit de1034b3 authored by Andrew Bresticker's avatar Andrew Bresticker Committed by Ard Biesheuvel

efi: runtime: Fix potential overflow of soft-reserved region size

md_size will have been narrowed if we have >= 4GB worth of pages in a
soft-reserved region.
Signed-off-by: default avatarAndrew Bresticker <abrestic@rivosinc.com>
Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
parent aa0e784d
...@@ -107,7 +107,7 @@ static int __init arm_enable_runtime_services(void) ...@@ -107,7 +107,7 @@ static int __init arm_enable_runtime_services(void)
efi_memory_desc_t *md; efi_memory_desc_t *md;
for_each_efi_memory_desc(md) { for_each_efi_memory_desc(md) {
int md_size = md->num_pages << EFI_PAGE_SHIFT; u64 md_size = md->num_pages << EFI_PAGE_SHIFT;
struct resource *res; struct resource *res;
if (!(md->attribute & EFI_MEMORY_SP)) if (!(md->attribute & EFI_MEMORY_SP))
......
...@@ -85,7 +85,7 @@ static int __init riscv_enable_runtime_services(void) ...@@ -85,7 +85,7 @@ static int __init riscv_enable_runtime_services(void)
efi_memory_desc_t *md; efi_memory_desc_t *md;
for_each_efi_memory_desc(md) { for_each_efi_memory_desc(md) {
int md_size = md->num_pages << EFI_PAGE_SHIFT; u64 md_size = md->num_pages << EFI_PAGE_SHIFT;
struct resource *res; struct resource *res;
if (!(md->attribute & EFI_MEMORY_SP)) if (!(md->attribute & EFI_MEMORY_SP))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment