mem: ensure proc_mmap is only called when locked
This commit is contained in:
parent
9c5d722f72
commit
8ea5c58fef
2 changed files with 7 additions and 4 deletions
|
|
@ -65,6 +65,7 @@ pid_t elf_load_proc(char *fname)
|
|||
|
||||
struct proc *proc = proc_create();
|
||||
/* allocate page tables */
|
||||
spinlock_acquire(&proc->lock);
|
||||
proc->cr3 = (uintptr_t)buddy_alloc(0x1000);
|
||||
|
||||
/* map kernel pages */
|
||||
|
|
@ -114,5 +115,7 @@ pid_t elf_load_proc(char *fname)
|
|||
|
||||
kfree(buf);
|
||||
|
||||
spinlock_release(&proc->lock);
|
||||
|
||||
return proc->pid;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue