From 643e14d0941fad1e2105aaf8ed5c3ca1dcffdb56 Mon Sep 17 00:00:00 2001 From: Andrew Turner Date: Fri, 9 Sep 2022 08:42:49 +0100 Subject: [PATCH] Use the correct size when checking an EFI address Use the correct page size macro when checking if an address is with the EFI runtime map. This would previously work correctly when the page size is 4k. With a larger page size it may incorrectly detect memory as within the map when it's not. Reported by: imp Sponsored by: Innovate UK --- sys/dev/efidev/efirt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/efidev/efirt.c b/sys/dev/efidev/efirt.c index 387cde5be331..e4c47fa68741 100644 --- a/sys/dev/efidev/efirt.c +++ b/sys/dev/efidev/efirt.c @@ -137,7 +137,7 @@ efi_is_in_map(struct efi_md *map, int ndesc, int descsz, vm_offset_t addr) continue; if (addr >= p->md_virt && - addr < p->md_virt + p->md_pages * PAGE_SIZE) + addr < p->md_virt + p->md_pages * EFI_PAGE_SIZE) return (true); }