1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00
freebsd/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
ctypedef
dict
doc
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
keys
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
msgdef
numericdef
security
sendmail
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
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
Makefile.inc