From d3de138d64e49bf04fcd1aaa5a98dff8bf230f91 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 28 Jan 2021 14:51:34 +0100 Subject: [PATCH] Kernel: Add sanity check assertion in RangeAllocator::allocate_specific The specific virtual address should always be page aligned. --- Kernel/VM/RangeAllocator.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Kernel/VM/RangeAllocator.cpp b/Kernel/VM/RangeAllocator.cpp index 6db31078ae..f092962ae8 100644 --- a/Kernel/VM/RangeAllocator.cpp +++ b/Kernel/VM/RangeAllocator.cpp @@ -155,6 +155,7 @@ Optional RangeAllocator::allocate_specific(VirtualAddress base, size_t si if (!size) return {}; + ASSERT(base.is_page_aligned()); ASSERT((size % PAGE_SIZE) == 0); Range allocated_range(base, size);