summaryrefslogtreecommitdiff
path: root/Kernel/VM
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-01-30 21:48:41 +0100
committerAndreas Kling <kling@serenityos.org>2020-01-30 21:51:27 +0100
commit31a141bd101e0483553aabe1a91e6efc86d483cd (patch)
treea8fa8fda00ce40aabe50d189ccc9478aac0d63aa /Kernel/VM
parent31d1c82621ffd0d8ed9236859150f7de8914560b (diff)
downloadserenity-31a141bd101e0483553aabe1a91e6efc86d483cd.zip
Kernel: Range::contains() should reject ranges with 2^32 wrap-around
Diffstat (limited to 'Kernel/VM')
-rw-r--r--Kernel/VM/RangeAllocator.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/Kernel/VM/RangeAllocator.h b/Kernel/VM/RangeAllocator.h
index bc6ce844a6..999282deff 100644
--- a/Kernel/VM/RangeAllocator.h
+++ b/Kernel/VM/RangeAllocator.h
@@ -57,6 +57,8 @@ public:
bool contains(VirtualAddress base, size_t size) const
{
+ if (base.offset(size) < base)
+ return false;
return base >= m_base && base.offset(size) <= end();
}