Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Feb 2018 00:25:18 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r329252 - head/sys/vm
Message-ID:  <201802140025.w1E0PIvc004313@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;
+			}
 		}
 	}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802140025.w1E0PIvc004313>