git: b0423d0f5eec - main - amd64: Zero the PML5 PTI page when initializing a pmap
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 18 Oct 2021 14:08:09 UTC
The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b0423d0f5eec89bd6c11c32649603031e3dbbfe1 commit b0423d0f5eec89bd6c11c32649603031e3dbbfe1 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2021-10-18 13:29:20 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2021-10-18 13:50:42 +0000 amd64: Zero the PML5 PTI page when initializing a pmap The root page is not zeroed at allocation time since with 4-level tables each entry is copied from a template. However, with 5-level tables only a single entry is filled, so the rest need to be cleared. Reported by: alc Reviewed by: alc, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32525 --- sys/amd64/amd64/pmap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index f1ddbe548c0f..168c9eec1b66 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -4293,6 +4293,7 @@ pmap_pinit_pml5_pti(vm_page_t pml5pgu) pml5_entry_t *pm_pml5u; pm_pml5u = (pml5_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pml5pgu)); + pagezero(pm_pml5u); /* * Add pml5 entry at top of KVA pointing to existing pml4 pti