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
This commit is contained in:
Mark Johnston 2019-09-23 14:11:59 +00:00
parent f9bf9282c9
commit 751727948a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=352622

View File

@ -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 mode)
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);
}
/*