Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Sep 2019 14:12:00 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r352622 - head/sys/amd64/amd64
Message-ID:  <201909231412.x8NEC0D4039334@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Mon Sep 23 14:11:59 2019
New Revision: 352622
URL: https://svnweb.freebsd.org/changeset/base/352622

Log:
  Set NX in mappings created by pmap_kenter() and pmap_kenter_attr().
  
  There does not appear to be any existing need for such mappings to be
  executable.
  
  Reviewed by:	alc, kib
  MFC after:	1 month
  Sponsored by:	Netflix
  Differential Revision:	https://reviews.freebsd.org/D21754

Modified:
  head/sys/amd64/amd64/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c	Mon Sep 23 13:45:50 2019	(r352621)
+++ head/sys/amd64/amd64/pmap.c	Mon Sep 23 14:11:59 2019	(r352622)
@@ -3134,7 +3134,7 @@ pmap_kenter(vm_offset_t va, vm_paddr_t pa)
 	pt_entry_t *pte;
 
 	pte = vtopte(va);
-	pte_store(pte, pa | X86_PG_RW | X86_PG_V | pg_g);
+	pte_store(pte, pa | X86_PG_RW | X86_PG_V | pg_g | pg_nx);
 }
 
 static __inline void
@@ -3145,7 +3145,7 @@ pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int mo
 
 	pte = vtopte(va);
 	cache_bits = pmap_cache_bits(kernel_pmap, mode, 0);
-	pte_store(pte, pa | X86_PG_RW | X86_PG_V | pg_g | cache_bits);
+	pte_store(pte, pa | X86_PG_RW | X86_PG_V | pg_g | pg_nx | cache_bits);
 }
 
 /*



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