summaryrefslogtreecommitdiff
path: root/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-mmap.patch
diff options
context:
space:
mode:
Diffstat (limited to 'sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-mmap.patch')
-rw-r--r--sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-mmap.patch20
1 files changed, 20 insertions, 0 deletions
diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-mmap.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-mmap.patch
new file mode 100644
index 000000000000..ef2d0a78206b
--- /dev/null
+++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-9.1-mmap.patch
@@ -0,0 +1,20 @@
+http://www.freebsd.org/security/advisories/FreeBSD-SA-13:06.mmap.asc
+https://bugs.gentoo.org/show_bug.cgi?id=473688
+
+Index: sys/vm/vm_map.c
+===================================================================
+--- sys/vm/vm_map.c (revision 251636)
++++ sys/vm/vm_map.c (working copy)
+@@ -3761,6 +3761,12 @@ RetryLookup:;
+ vm_map_unlock_read(map);
+ return (KERN_PROTECTION_FAILURE);
+ }
++ if ((fault_typea & VM_PROT_COPY) != 0 &&
++ (entry->max_protection & VM_PROT_WRITE) == 0 &&
++ (entry->eflags & MAP_ENTRY_COW) == 0) {
++ vm_map_unlock_read(map);
++ return (KERN_PROTECTION_FAILURE);
++ }
+
+ /*
+ * If this page is not pageable, we have to get it for all possible