NetBSD/sys
maxv daaf22542e Modify the hotpatch mechanism, in order to make it much less ROP-friendly.
Currently x86_patch_window_open is a big problem, because it is a perfect
function to inject/modify executable code with ROP.

 - Remove x86_patch_window_open(), along with its x86_patch_window_close()
   counterpart.
 - Introduce a read-only link-set of hotpatch descriptor structures,
   which reference a maximum of two read-only hotpatch sources.
 - Modify x86_hotpatch() to open a window and call the new
   x86_hotpatch_apply() function in a hard-coded manner.
 - Modify x86_hotpatch() to take a name and a selector, and have
   x86_hotpatch_apply() resolve the descriptor from the name and the
   source from the selector, before hotpatching.
 - Move the error handling in a separate x86_hotpatch_cleanup() function,
   that gets called after we closed the window.

The resulting implementation is a bit complex and non-obvious. But it
gains the following properties: the code executed in the hotpatch window
is strictly hard-coded (no callback and no possibility to execute your own
code in the window) and the pointers this code accesses are strictly
read-only (no possibility to forge pointers to hotpatch an area that was
not designated as hotpatchable at compile-time, and no possibility to
choose what bytes to write other than the maximum of two read-only
templates that were designated as valid for the given destination at
compile-time).

With current CPUs this slightly improves a situation that is already
pretty bad by definition on x86. Assuming CET however, this change closes
a big hole and is kinda great.

The only ~problem there is, is that dtrace-fbt tries to hotpatch random
places with random bytes, and there is just no way to make it safe.
However dtrace is only in a module, that is rarely used and never compiled
into the kernel, so it's not a big problem; add a shitty & vulnerable
independent hotpatch window in it, and leave big XXXs. It looks like fbt
is going to collapse soon anyway.
2020-05-02 11:37:17 +00:00
..
altq Need opt_inet.h for #ifdef INET, INET6. 2020-03-05 07:46:36 +00:00
arch Modify the hotpatch mechanism, in order to make it much less ROP-friendly. 2020-05-02 11:37:17 +00:00
coda Replace most uses of vp->v_usecount with a call to vrefcnt(vp), a function 2020-04-13 19:23:17 +00:00
compat Omit needless #include <sys/rnd.h>. 2020-04-30 03:30:10 +00:00
conf Make crypto/rijindael optional again as cprng_strong does no longer 2020-04-22 09:15:39 +00:00
crypto Count cprng_fast reseed events. 2020-04-30 03:29:45 +00:00
ddb Handle "no count" properly in db_kernhist_print_cmd 2020-04-13 11:43:27 +00:00
dev Don't attempt to read opcodes and their timeouts at attach time for 2020-05-02 06:45:53 +00:00
dist/pf Need opt_inet.h for #ifdef INET, INET6. 2020-03-05 07:46:36 +00:00
external Fix possible bus_dmamap_load(9) leak. PR/55127 2020-04-27 16:57:31 +00:00
fs autofs: Silence down a warning which should really be a debug message 2020-04-26 17:00:31 +00:00
gdbscripts mention the need to reload the kernel symbols 2020-05-01 17:00:42 +00:00
kern Fix inverted condition in r1.136 - we do want LOCKDEBUG spinouts of the 2020-05-02 09:13:40 +00:00
lib Rewrite entropy subsystem. 2020-04-30 03:28:18 +00:00
miscfs Put forward declaration a little further forward to unbreak build. 2020-04-29 07:18:24 +00:00
modules s/&&/&/ and also return POLLRDNORM (pointed out by joerg@) 2020-05-01 21:42:34 +00:00
net report no enabled capabilities when no interface is part of bridge 2020-05-01 22:27:42 +00:00
net80211 Define and implement a locking protocol for the ifmedia / mii layers: 2020-03-15 23:04:50 +00:00
netatalk
netbt pass the address of the field, instead of relying on it being the first 2020-02-29 11:40:06 +00:00
netcan
netinet Omit needless #include <sys/rnd.h>. 2020-04-30 03:30:10 +00:00
netinet6 inet6: Ensure that route MTU is guarded by ARC_PHDS_MAXMTU 2020-04-28 15:12:28 +00:00
netipsec Make crypto/rijindael optional again as cprng_strong does no longer 2020-04-22 09:15:39 +00:00
netmpls
nfs Resolve delayed truncation from nfs_inactive() too. 2020-05-01 08:43:00 +00:00
opencrypto Make crypto/rijindael optional again as cprng_strong does no longer 2020-04-22 09:15:39 +00:00
rump No need for a lock around rnd_add_data any more. 2020-04-30 03:41:20 +00:00
secmodel Use the module subsystem's ability to process SYSCTL_SETUP() entries to 2020-03-16 21:20:09 +00:00
stand Adjust for binutils 2.34 in the same manner as efiboot/x86: 2020-04-26 06:51:35 +00:00
sys GNU as on ARM silently accepts @progbits, but interpretes it as comment 2020-04-30 14:32:05 +00:00
ufs There is no difference between a zero-sized and not yet 2020-05-01 08:43:37 +00:00
uvm - In uvm_voaddr_acquire(), take an extra hold on the anon lock obj. 2020-04-30 04:18:07 +00:00
Makefile remove SMBFS and nsmb(4) - kernel part 2020-04-04 15:43:21 +00:00