mirror of
https://github.com/opnsense/src.git
synced 2026-05-19 16:35:42 -04:00
Use pmap_remove_all() instead of pmap_remove() before freeing the page
in vm_pgmoveco(); the page may have more than one mapping. Hold the page queues lock when calling pmap_remove_all(). Approved by: re (blanket)
This commit is contained in:
parent
e80b7b691e
commit
fdff30d256
1 changed files with 4 additions and 5 deletions
|
|
@ -104,12 +104,11 @@ vm_pgmoveco(mapa, srcobj, kaddr, uaddr)
|
|||
return(EFAULT);
|
||||
}
|
||||
if ((user_pg = vm_page_lookup(uobject, upindex)) != NULL) {
|
||||
vm_page_lock_queues();
|
||||
if (!vm_page_sleep_if_busy(user_pg, 1, "vm_pgmoveco"))
|
||||
vm_page_unlock_queues();
|
||||
pmap_remove(map->pmap, uaddr, uaddr+PAGE_SIZE);
|
||||
vm_page_lock_queues();
|
||||
do
|
||||
vm_page_lock_queues();
|
||||
while (vm_page_sleep_if_busy(user_pg, 1, "vm_pgmoveco"));
|
||||
vm_page_busy(user_pg);
|
||||
pmap_remove_all(user_pg);
|
||||
vm_page_free(user_pg);
|
||||
vm_page_unlock_queues();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue