mirror of
https://github.com/drasko/codezero.git
synced 2026-01-29 11:13:14 +01:00
Mapping precision fixes on l4_unmap and do_munmap()
l4_unmap now returns -1 if given range was only partially unmapped. do_munmap() now only unmaps address ranges that have correspondence in the unmapped vmas. Trying to unmap regions with no correspondent vmas causes problems in corner cases, e.g. mm0 that tries to mmap its own address space during initialisation would unmap its whole address space and fail to execute.
This commit is contained in:
@@ -146,7 +146,7 @@ int do_shmdt(struct tcb *task, struct vm_file *shm)
|
||||
int err;
|
||||
|
||||
if ((err = do_munmap(task,
|
||||
shm_file_to_desc(shm)->shm_addr,
|
||||
(unsigned long)shm_file_to_desc(shm)->shm_addr,
|
||||
shm_file_to_desc(shm)->npages)) < 0)
|
||||
return err;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user