diff options
-rw-r--r-- | sys/vm/vm_map.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 8d15263..84e12c6 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -1284,12 +1284,14 @@ vm_map_protect(vm_map_t map, vm_offset_t start, vm_offset_t end, */ if (current->protection != old_prot) { mtx_lock(&Giant); + vm_page_lock_queues(); #define MASK(entry) (((entry)->eflags & MAP_ENTRY_COW) ? ~VM_PROT_WRITE : \ VM_PROT_ALL) pmap_protect(map->pmap, current->start, current->end, current->protection & MASK(current)); #undef MASK + vm_page_unlock_queues(); mtx_unlock(&Giant); } vm_map_simplify_entry(map, current); @@ -2197,10 +2199,12 @@ vm_map_copy_entry( * write-protected. */ if ((src_entry->eflags & MAP_ENTRY_NEEDS_COPY) == 0) { + vm_page_lock_queues(); pmap_protect(src_map->pmap, src_entry->start, src_entry->end, src_entry->protection & ~VM_PROT_WRITE); + vm_page_unlock_queues(); } /* |