From 31a141bd101e0483553aabe1a91e6efc86d483cd Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 30 Jan 2020 21:48:41 +0100 Subject: [PATCH] Kernel: Range::contains() should reject ranges with 2^32 wrap-around --- Kernel/VM/RangeAllocator.h | 2 ++ 1 file changed, 2 insertions(+) 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(); }