From 71ecdd7245f073424a88c27d9964199093979f6b Mon Sep 17 00:00:00 2001 From: Bananymous Date: Mon, 30 Oct 2023 19:20:17 +0200 Subject: [PATCH] Kernel: Canonicalize vaddr before using it --- kernel/arch/x86_64/PageTable.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/arch/x86_64/PageTable.cpp b/kernel/arch/x86_64/PageTable.cpp index bc2f4d40f1..d3c5357024 100644 --- a/kernel/arch/x86_64/PageTable.cpp +++ b/kernel/arch/x86_64/PageTable.cpp @@ -580,8 +580,9 @@ namespace Kernel vaddr |= (uint64_t)pdpte << 30; vaddr |= (uint64_t)pde << 21; vaddr |= (uint64_t)pte << 12; + vaddr = canonicalize(vaddr); ASSERT(reserve_page(vaddr)); - return canonicalize(vaddr); + return vaddr; } } }