mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
- Avoid a lock-order reversal between Giant and a system map mutex that
occurs when kmem_malloc() fails to allocate a sufficient number of vm pages. Specifically, we avoid the lock-order reversal by not grabbing Giant around pmap_remove() if the map is the kmem_map. Approved by: re (jhb) Reported by: Eugene <eugene3@web.de>
This commit is contained in:
parent
b8aeddf146
commit
1cd5fbd854
1 changed files with 4 additions and 2 deletions
|
|
@ -2173,11 +2173,13 @@ vm_map_delete(vm_map_t map, vm_offset_t start, vm_offset_t end)
|
|||
vm_map_entry_unwire(map, entry);
|
||||
}
|
||||
|
||||
mtx_lock(&Giant);
|
||||
if (map != kmem_map)
|
||||
mtx_lock(&Giant);
|
||||
vm_page_lock_queues();
|
||||
pmap_remove(map->pmap, entry->start, entry->end);
|
||||
vm_page_unlock_queues();
|
||||
mtx_unlock(&Giant);
|
||||
if (map != kmem_map)
|
||||
mtx_unlock(&Giant);
|
||||
|
||||
/*
|
||||
* Delete the entry (which may delete the object) only after
|
||||
|
|
|
|||
Loading…
Reference in a new issue