o Remove GIANT_REQUIRED from vm_map_lookup_entry() and
vm_map_check_protection(). o Call vm_map_check_protection() without Giant held in munmap().
This commit is contained in:
parent
48ff9098aa
commit
d44b3a12b3
@ -590,7 +590,6 @@ vm_map_lookup_entry(
|
||||
vm_map_entry_t cur;
|
||||
vm_map_entry_t last;
|
||||
|
||||
GIANT_REQUIRED;
|
||||
/*
|
||||
* Start looking either from the head of the list, or from the hint.
|
||||
*/
|
||||
@ -2148,8 +2147,6 @@ vm_map_check_protection(vm_map_t map, vm_offset_t start, vm_offset_t end,
|
||||
vm_map_entry_t entry;
|
||||
vm_map_entry_t tmp_entry;
|
||||
|
||||
GIANT_REQUIRED;
|
||||
|
||||
vm_map_lock_read(map);
|
||||
if (!vm_map_lookup_entry(map, start, &tmp_entry)) {
|
||||
vm_map_unlock_read(map);
|
||||
|
@ -607,16 +607,15 @@ munmap(td, uap)
|
||||
if (VM_MIN_ADDRESS > 0 && addr < VM_MIN_ADDRESS)
|
||||
return (EINVAL);
|
||||
#endif
|
||||
mtx_lock(&Giant);
|
||||
map = &td->td_proc->p_vmspace->vm_map;
|
||||
/*
|
||||
* Make sure entire range is allocated.
|
||||
*/
|
||||
if (!vm_map_check_protection(map, addr, addr + size, VM_PROT_NONE)) {
|
||||
mtx_unlock(&Giant);
|
||||
if (!vm_map_check_protection(map, addr, addr + size, VM_PROT_NONE))
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
/* returns nothing but KERN_SUCCESS anyway */
|
||||
mtx_lock(&Giant);
|
||||
(void) vm_map_remove(map, addr, addr + size);
|
||||
mtx_unlock(&Giant);
|
||||
return (0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user