Author: glebius
Date: Fri Oct 30 13:05:39 2015
New Revision: 290194
URL: https://svnweb.freebsd.org/changeset/base/290194

Log:
  MFC r287591 by kib:
  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.

Modified:
  stable/9/sys/vm/vm_map.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/vm/vm_map.c
==============================================================================
--- stable/9/sys/vm/vm_map.c    Fri Oct 30 12:37:40 2015        (r290193)
+++ stable/9/sys/vm/vm_map.c    Fri Oct 30 13:05:39 2015        (r290194)
@@ -3878,12 +3878,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) {
@@ -4037,10 +4035,6 @@ vm_map_lookup_locked(vm_map_t *var_map,  
        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
_______________________________________________
svn-src-stable-9@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-9
To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"

Reply via email to