VM: make munmap(2) round length up, not down (reported by Althaf K Backer)

This commit is contained in:
David van Moolenbroek 2010-01-05 09:40:07 +00:00
parent 0dcf5b7aa8
commit be992434e7

View 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;