svn commit: r329707 - stable/10/sys/vm

Konstantin Belousov kib at FreeBSD.org
Wed Feb 21 11:31:30 UTC 2018


Author: kib
Date: Wed Feb 21 11:31:29 2018
New Revision: 329707
URL: https://svnweb.freebsd.org/changeset/base/329707

Log:
  MFC r329254:
  Ensure memory consistency on COW.

Modified:
  stable/10/sys/vm/vm_fault.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/vm/vm_fault.c
==============================================================================
--- stable/10/sys/vm/vm_fault.c	Wed Feb 21 11:29:07 2018	(r329706)
+++ stable/10/sys/vm/vm_fault.c	Wed Feb 21 11:31:29 2018	(r329707)
@@ -893,6 +893,10 @@ readrest:
 				 */
 				pmap_copy_page(fs.m, fs.first_m);
 				fs.first_m->valid = VM_PAGE_BITS_ALL;
+				if ((fault_flags & VM_FAULT_WIRE) == 0) {
+					prot &= ~VM_PROT_WRITE;
+					fault_type &= ~VM_PROT_WRITE;
+				}
 				if (wired && (fault_flags &
 				    VM_FAULT_WIRE) == 0) {
 					vm_page_lock(fs.first_m);


More information about the svn-src-stable mailing list