Fix chunk manager munmap range

When the munmap range is bigger than the Multi-VMA chunk's range, the
bound was wrong and the munmap will misbehave.
This commit is contained in:
Hui, Chunyang 2022-05-10 11:02:24 +00:00 committed by volcano
parent cf080a46a0
commit fd950132ce

@ -141,7 +141,9 @@ impl ChunkManager {
} }
pub fn munmap_range(&mut self, range: VMRange) -> Result<()> { pub fn munmap_range(&mut self, range: VMRange) -> Result<()> {
let bound = range.start(); // The bound should be no smaller than the chunk range's start address.
let bound = range.start().max(self.range.start());
let current_pid = current!().process().pid(); let current_pid = current!().process().pid();
// The cursor to iterate vmas that might intersect with munmap_range. // The cursor to iterate vmas that might intersect with munmap_range.