git: 643e14d0941f - main - Use the correct size when checking an EFI address

From: Andrew Turner <andrew_at_FreeBSD.org>
Date: Fri, 09 Sep 2022 07:47:37 UTC
The branch main has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=643e14d0941fad1e2105aaf8ed5c3ca1dcffdb56

commit 643e14d0941fad1e2105aaf8ed5c3ca1dcffdb56
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2022-09-09 07:42:49 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2022-09-09 07:47:15 +0000

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