From: David van Moolenbroek Date: Tue, 5 Jan 2010 09:40:07 +0000 (+0000) Subject: VM: make munmap(2) round length up, not down (reported by Althaf K Backer) X-Git-Tag: v3.1.6~114 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/man.dnssec-keyfromlabel.html?a=commitdiff_plain;h=be992434e7e646b6a07f40bead5d84298024d4d3;p=minix.git VM: make munmap(2) round length up, not down (reported by Althaf K Backer) --- diff --git a/servers/vm/mmap.c b/servers/vm/mmap.c index 5abc459b6..686db4779 100644 --- a/servers/vm/mmap.c +++ b/servers/vm/mmap.c @@ -374,7 +374,8 @@ PUBLIC int do_munmap(message *m) } len = m->VMUM_LEN; - len -= len % VM_PAGE_SIZE; + if (len % VM_PAGE_SIZE) + len += VM_PAGE_SIZE - (len % VM_PAGE_SIZE); if(addr != vr->vaddr || len > vr->length || len < VM_PAGE_SIZE) { return EFAULT;