]> Zhao Yanbai Git Server - minix.git/commitdiff
VM: make munmap(2) round length up, not down (reported by Althaf K Backer)
authorDavid van Moolenbroek <david@minix3.org>
Tue, 5 Jan 2010 09:40:07 +0000 (09:40 +0000)
committerDavid van Moolenbroek <david@minix3.org>
Tue, 5 Jan 2010 09:40:07 +0000 (09:40 +0000)
servers/vm/mmap.c

index 5abc459b6887b817db0b8c1b761c107b63df671a..686db47794b4dbc2a58e11f1a3cda4e5c7dbabff 100644 (file)
@@ -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;