diff options
author | Andreas Kling <kling@serenityos.org> | 2022-04-03 23:07:29 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-04-03 23:07:29 +0200 |
commit | 9765f9f67ed5bbb6a77b10d0ec23381c12c0dbd2 (patch) | |
tree | 5438a3cf30e9957ed5f21726f7d2ae1ec0d79eb6 | |
parent | 36d829b97c1897a75c7c4d156a8ba5fdaf96ef49 (diff) | |
download | serenity-9765f9f67ed5bbb6a77b10d0ec23381c12c0dbd2.zip |
Kernel: Fix accidental overlaps in RegionTree::allocate_range_specific()
Thanks to Idan for spotting this! :^)
-rw-r--r-- | Kernel/Memory/RegionTree.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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<VirtualRange> 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; |