freebsd-dev/sys
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
..
amd64 Make UMA and malloc(9) return non-executable memory in most cases. 2018-06-13 17:04:41 +00:00
arm hwpmc: remove hwpmc_xscale.c from corresponding arm build 2018-06-08 18:24:46 +00:00
arm64 Add ThunderX2 to the list of CPUs we need to apply the branch predictor 2018-06-13 15:58:33 +00:00
bsm
cam Enable high-speed on the card before increasing frequency on the controller 2018-06-05 11:03:24 +00:00
cddl This originated from ZFS On Linux, as 2018-06-08 17:38:28 +00:00
compat Oops, r335053 had an old version of the comment about 16-bit linux dev_t 2018-06-13 12:44:45 +00:00
conf Add support for the ARM SMC Calling Convention (SMCCC). This is a method 2018-06-13 15:32:00 +00:00
contrib [ath_hal] Return failure if noise floor calibration fails. 2018-06-08 18:21:57 +00:00
crypto disable printing value of SKEIN_LOOP during standard out, 2018-05-19 18:27:14 +00:00
ddb Extend show proc with reaper, sigparent, and vmspace information 2018-05-25 13:59:48 +00:00
dev Add the SMCCC return codes from ARM DEN 0070A. 2018-06-13 15:41:22 +00:00
dts arm: overlays: Update to new path-based sugar format 2018-05-04 14:38:48 +00:00
fs Fix the encoding of major and minor numbers in 64-bit dev_t by restoring 2018-06-13 12:22:00 +00:00
gdb amd64: Protect the kernel text, data, and BSS by setting the RW/NX bits 2018-03-06 14:28:37 +00:00
geom Introduce the 'n' flag for the geli attach command. 2018-05-09 20:53:38 +00:00
gnu gnu/dts: Update our copy of arm dts from Linux 4.16 2018-04-20 19:37:08 +00:00
i386 Make UMA and malloc(9) return non-executable memory in most cases. 2018-06-13 17:04:41 +00:00
isa Revert r330780, it was improperly tested and results in taking a spin 2018-03-11 20:13:15 +00:00
kern Make UMA and malloc(9) return non-executable memory in most cases. 2018-06-13 17:04:41 +00:00
kgssapi
libkern str(r)chr: Replace union abuse with __DECONST 2018-06-04 18:47:14 +00:00
mips hwpmc: yet another missed fixup 2018-06-08 18:54:47 +00:00
modules linux64: use linux output target for linux_vdso.so 2018-06-12 13:32:42 +00:00
net Make UMA and malloc(9) return non-executable memory in most cases. 2018-06-13 17:04:41 +00:00
net80211 Use an accessor function to access ifr_data. 2018-03-30 18:50:13 +00:00
netgraph Catch up two more places to the V_ifnet change to a CK_STAILQ. 2018-05-24 00:06:55 +00:00
netinet Rework if_gre(4) to use encap_lookup_t method to speedup lookup 2018-06-13 11:11:33 +00:00
netinet6 Rework if_gre(4) to use encap_lookup_t method to speedup lookup 2018-06-13 11:11:33 +00:00
netipsec uma: implement provisional api for per-cpu zones 2018-06-08 21:40:03 +00:00
netpfil pf: Fix deadlock with route-to 2018-06-09 14:17:06 +00:00
netsmb Eliminate the overhead of gratuitous repeated reinitialization of cap_rights 2018-05-09 18:47:24 +00:00
nfs Merge the pNFS server code from projects/pnfs-planb-server into head. 2018-06-12 19:36:32 +00:00
nfsclient
nfsserver
nlm
ofed UDP: further performance improvements on tx 2018-05-23 21:02:14 +00:00
opencrypto cryptosoft: Do not exceed crd_len around *crypt_multi 2018-04-19 15:24:21 +00:00
powerpc powerpc64/powernv: Avoid type promotion 2018-06-12 19:50:33 +00:00
riscv Don't jump to VA space until kernel is ready. 2018-06-13 10:32:21 +00:00
rpc
security audit(4): fix the definition of ARG_TERMID_ADDR 2018-06-13 14:55:31 +00:00
sparc64 Define memmove and make bcopy alt entry point 2018-05-24 21:11:28 +00:00
sys Make UMA and malloc(9) return non-executable memory in most cases. 2018-06-13 17:04:41 +00:00
teken teken: Fix sequences header which was crossing the 80-col boundary 2018-05-29 08:41:44 +00:00
tests epoch(9): Make epochs non-preemptible by default 2018-05-18 17:29:43 +00:00
tools Add dtb overlays support 2018-03-24 21:30:24 +00:00
ufs ufs: remove cgbno variable where unused 2018-05-19 19:30:42 +00:00
vm Make UMA and malloc(9) return non-executable memory in most cases. 2018-06-13 17:04:41 +00:00
x86 Untangle configuration ifdefs a little. On x86, msi is optional on pci, 2018-06-10 14:49:13 +00:00
xdr
xen xen: remove dead code from gnttab.h 2018-05-25 08:44:00 +00:00
Makefile