From add156b750d77132ca2d063a4718ac1a5139e59a Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sat, 27 Sep 2025 06:46:21 -0400 Subject: kern/amd64: mmu: Map with zero if prot is also zero To ensure that all residual data does not remain for the mapping in its table, we write a flat zero if prot is also zero i.e., no permissions Signed-off-by: Ian Moffett --- src/sys/arch/amd64/cpu/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/sys') diff --git a/src/sys/arch/amd64/cpu/mmu.c b/src/sys/arch/amd64/cpu/mmu.c index 89f53f0..04b43c1 100644 --- a/src/sys/arch/amd64/cpu/mmu.c +++ b/src/sys/arch/amd64/cpu/mmu.c @@ -342,7 +342,7 @@ mmu_map_single(struct vm_vas *vas, struct mmu_map *spec, int prot) * TLB entry. */ index = mmu_get_level(spec->va, MMU_TBL); - pte[index] = pte_flags | spec->pa; + pte[index] = (prot == 0) ? 0 : (pte_flags | spec->pa); __invlpg((void *)spec->va); return 0; } -- cgit v1.2.3