Kernel - Enable NX for PROT_READ by default
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 12 Jun 2018 17:18:41 +0000 (10:18 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 12 Jun 2018 17:28:45 +0000 (10:28 -0700)
commitd92e38903042e325890d90f72881cc9ed0718db7
treef8d8f42e910e6b8ee9dd71b8fd758cc07c125f84
parent2137724ad5a91628e60b420c466d8ddf266266d5
Kernel - Enable NX for PROT_READ by default

* We've had NX support for a while, requiring a loader.conf tunable to
  enable (machdep.pmap_nx_enable).

* Enhance the feature to support two modes.  Mode 1 allows NX support
  for PROT_READ mappings, Mode 2 allows NX support for both PROT_READ
  and PROT_WRITE mappings.

  Third party code should work universally with Mode 1, but apparently
  quite a bit still does not work with mode 2.

* Change the default from disabled to Mode 1 in master, lets see if
  anyone has any problems with it.

Suggested-by: Theo de Raadt
sys/platform/pc64/x86_64/pmap.c