From 9765f9f67ed5bbb6a77b10d0ec23381c12c0dbd2 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 3 Apr 2022 23:07:29 +0200 Subject: Kernel: Fix accidental overlaps in RegionTree::allocate_range_specific() Thanks to Idan for spotting this! :^) --- Kernel/Memory/RegionTree.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/Memory/RegionTree.cpp b/Kernel/Memory/RegionTree.cpp index 876315b10c..cfe5aaf321 100644 --- a/Kernel/Memory/RegionTree.cpp +++ b/Kernel/Memory/RegionTree.cpp @@ -90,7 +90,7 @@ ErrorOr RegionTree::allocate_range_specific(VirtualAddress base, s if (!m_total_range.contains(range)) return ENOMEM; - auto* region = m_regions.find_largest_not_above(base.get()); + auto* region = m_regions.find_largest_not_above(base.offset(size).get()); if (!region) { // The range can be accommodated below the current lowest range. return range; -- cgit v1.2.3