From a761b820c761e8e3bac005c13bb88f6c1b05a6fd Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Sat, 20 Jul 2019 20:16:51 -0700 Subject: [PATCH] vm-allocator: Fix the aligned address check The requested address for a range can be the base of the entire address space, this is a valid use case. In particular, when creating an MMIO address space of 0-64GiB, we might want to create a range of 0-1GiB if the RAM of our VM is 1G. Signed-off-by: Sebastien Boeuf --- vm-allocator/src/address.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vm-allocator/src/address.rs b/vm-allocator/src/address.rs index 8d35e4548..bfb99f36a 100755 --- a/vm-allocator/src/address.rs +++ b/vm-allocator/src/address.rs @@ -90,7 +90,7 @@ impl AddressAllocator { } // The aligned address should be within the address space range. - if aligned_address >= self.end || aligned_address <= self.base { + if aligned_address >= self.end || aligned_address < self.base { return Err(Error::Overflow); }