svn commit: r329252 - head/sys/vm

Konstantin Belousov kib at FreeBSD.org
Wed Feb 14 00:25:19 UTC 2018


Author: kib
Date: Wed Feb 14 00:25:18 2018
New Revision: 329252
URL: https://svnweb.freebsd.org/changeset/base/329252

Log:
  Do not call pmap_enter() with invalid protection mode.
  
  If the map entry elookup was performed due to the mapping changes, we
  need to ensure that there is still some access permission bit
  requested which is compatible with the current vm_map_entry mode.  If
  not, restart the handler from scratch instead of trying to save the
  current progress.
  
  Also adjust fault_type to not include cleared permission bits.
  
  Reviewed by:	markj
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week
  Differential revision:	https://reviews.freebsd.org/D14347

Modified:
  head/sys/vm/vm_fault.c

Modified: head/sys/vm/vm_fault.c
==============================================================================
--- head/sys/vm/vm_fault.c	Wed Feb 14 00:12:03 2018	(r329251)
+++ head/sys/vm/vm_fault.c	Wed Feb 14 00:25:18 2018	(r329252)
@@ -1219,6 +1219,12 @@ readrest:
 			 * write-enabled after all.
 			 */
 			prot &= retry_prot;
+			fault_type &= retry_prot;
+			if (prot == 0) {
+				release_page(&fs);
+				unlock_and_deallocate(&fs);
+				goto RetryFault;
+			}
 		}
 	}
 


More information about the svn-src-all mailing list