freebsd-dev/share
Jonathan T. Looney 0766f278d8 Make UMA and malloc(9) return non-executable memory in most cases.
Most kernel memory that is allocated after boot does not need to be
executable.  There are a few exceptions.  For example, kernel modules
do need executable memory, but they don't use UMA or malloc(9).  The
BPF JIT compiler also needs executable memory and did use malloc(9)
until r317072.

(Note that a side effect of r316767 was that the "small allocation"
path in UMA on amd64 already returned non-executable memory.  This
meant that some calls to malloc(9) or the UMA zone(9) allocator could
return executable memory, while others could return non-executable
memory.  This change makes the behavior consistent.)

This change makes malloc(9) return non-executable memory unless the new
M_EXEC flag is specified.  After this change, the UMA zone(9) allocator
will always return non-executable memory, and a KASSERT will catch
attempts to use the M_EXEC flag to allocate executable memory using
uma_zalloc() or its variants.

Allocations that do need executable memory have various choices.  They
may use the M_EXEC flag to malloc(9), or they may use a different VM
interfact to obtain executable pages.

Now that malloc(9) again allows executable allocations, this change also
reverts most of r317072.

PR:		228927
Reviewed by:	alc, kib, markj, jhb (previous version)
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D15691
2018-06-13 17:04:41 +00:00
..
colldef Update to CLDR 32 and Unicode 10 2017-11-03 13:52:34 +00:00
ctypedef Update to CLDR 32 and Unicode 10 2017-11-03 13:52:34 +00:00
dict Sync with NetBSD's /usr/share/dict/words, with the exception of quim 2017-12-16 20:25:50 +00:00
doc Update several more URLs 2017-10-29 08:17:03 +00:00
dtrace Introduce dwatch(1) as a tool for making DTrace more useful 2018-03-06 23:44:19 +00:00
examples hwpmc: add summary command and further metadata extensions 2018-06-06 02:48:09 +00:00
i18n share: normalize paths using SRCTOP-relative paths or :H when possible 2017-03-04 11:26:40 +00:00
keys META MODE: Update dependencies with 'the-lot' and add missing directories. 2015-12-01 05:23:19 +00:00
man Make UMA and malloc(9) return non-executable memory in most cases. 2018-06-13 17:04:41 +00:00
misc Add hrs, meta and myself to share/misc/committers-ports.dot 2018-06-12 07:51:03 +00:00
mk Use simpler sed invocation. 2018-06-07 19:39:11 +00:00
monetdef Update to CLDR 32 and Unicode 10 2017-11-03 13:52:34 +00:00
msgdef Update to CLDR 32 and Unicode 10 2017-11-03 13:52:34 +00:00
numericdef Update to CLDR 32 and Unicode 10 2017-11-03 13:52:34 +00:00
security META MODE: These need object directories to handle staging. 2015-11-26 01:14:27 +00:00
sendmail share: normalize paths using SRCTOP-relative paths or :H when possible 2017-03-04 11:26:40 +00:00
skel Simplify this Makefile. 2018-06-08 15:05:26 +00:00
snmp
syscons - Add us.iso Macbook/Macbook Pro keyboard support 2018-05-03 06:52:47 +00:00
tabset
termcap Add termcap entries for the st terminal (https://st.sucksless.org) 2018-03-15 15:13:17 +00:00
tests Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
timedef timedef: Update Czech timedef 2018-05-23 10:39:02 +00:00
vt Correct tom-thumb vt font glyphs 2018-04-13 17:37:39 +00:00
zoneinfo We don't actually need env here, so drop it. All shells allow setting 2018-02-09 15:50:32 +00:00
Makefile Convert traditional ${MK_TESTS} conditional idiom for including test 2017-08-02 08:35:51 +00:00
Makefile.inc