diff options
author | kib <kib@FreeBSD.org> | 2015-09-16 04:20:39 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2015-09-16 04:20:39 +0000 |
commit | 9d44cca55a3ee1fc861dbe408b9b4a74941b410b (patch) | |
tree | 7cbc84b023e0f35e4a18a9a6258d1e063bcb94dd | |
parent | e7aa94a56499f6c232a90bd3c3864dab8aa4b31d (diff) | |
download | FreeBSD-src-9d44cca55a3ee1fc861dbe408b9b4a74941b410b.zip FreeBSD-src-9d44cca55a3ee1fc861dbe408b9b4a74941b410b.tar.gz |
MFC r287591:
There is no reason in the current kernel to disallow write access to
the COW wired entry if the entry permissions allow it. Remove the check.
-rw-r--r-- | sys/vm/vm_map.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 93db8d1..46e3089 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -3989,12 +3989,10 @@ RetryLookup:; vm_map_unlock_read(map); return (KERN_PROTECTION_FAILURE); } - if ((entry->eflags & MAP_ENTRY_USER_WIRED) && - (entry->eflags & MAP_ENTRY_COW) && - (fault_type & VM_PROT_WRITE)) { - vm_map_unlock_read(map); - return (KERN_PROTECTION_FAILURE); - } + KASSERT((prot & VM_PROT_WRITE) == 0 || (entry->eflags & + (MAP_ENTRY_USER_WIRED | MAP_ENTRY_NEEDS_COPY)) != + (MAP_ENTRY_USER_WIRED | MAP_ENTRY_NEEDS_COPY), + ("entry %p flags %x", entry, entry->eflags)); if ((fault_typea & VM_PROT_COPY) != 0 && (entry->max_protection & VM_PROT_WRITE) == 0 && (entry->eflags & MAP_ENTRY_COW) == 0) { @@ -4148,10 +4146,6 @@ vm_map_lookup_locked(vm_map_t *var_map, /* IN/OUT */ fault_type &= VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE; if ((fault_type & prot) != fault_type) return (KERN_PROTECTION_FAILURE); - if ((entry->eflags & MAP_ENTRY_USER_WIRED) && - (entry->eflags & MAP_ENTRY_COW) && - (fault_type & VM_PROT_WRITE)) - return (KERN_PROTECTION_FAILURE); /* * If this page is not pageable, we have to get it for all possible |