opnsense-src/sys
Kyle Evans 60c4ec806d jail: allow root to implicitly widen its cpuset to attach
The default behavior for attaching processes to jails is that the jail's
cpuset augments the attaching processes, so that it cannot be used to
escalate a user's ability to take advantage of more CPUs than the
administrator wanted them to.

This is problematic when root needs to manage jails that have disjoint
sets with whatever process is attaching, as this would otherwise result
in a deadlock. Therefore, if we did not have an appropriate common
subset of cpus/domains for our new policy, we now allow the process to
simply take on the jail set *if* it has the privilege to widen its mask
anyways.

With the new logic, root can still usefully cpuset a process that
attaches to a jail with the desire of maintaining the set it was given
pre-attachment while still retaining the ability to manage child jails
without jumping through hoops.

A test has been added to demonstrate the issue; cpuset of a process
down to just the first CPU and attempting to attach to a jail without
access to any of the same CPUs previously resulted in EDEADLK and now
results in taking on the jail's mask for privileged users.

PR:		253724
Reviewed by:	jamie (also discussed with)
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D28952
2021-03-01 12:38:31 -06:00
..
amd64 pmap: Fix largemap restart checks in the kernel_maps sysctl handler 2021-02-25 18:49:47 -05:00
arm Remove __XSCALE__ checks from the arm code 2021-02-19 15:31:26 +00:00
arm64 AArch64: Don't set flush-subnormals-to-zero flag on startup 2021-03-01 14:27:30 +00:00
bsm Add aio_writev and aio_readv 2021-01-02 19:57:58 -07:00
cam Micro-optimize OOA queue processing. 2021-02-27 10:40:24 -05:00
cddl Reimplement the arm64 dtrace_gethrtime(), which provides the 2021-02-19 09:00:39 +00:00
compat Use atomic loads/stores when updating td->td_state 2021-02-18 14:02:48 +00:00
conf Remove stale references to opt_sio.h 2021-02-25 21:43:12 -04:00
contrib zfs: add missing seqc write begin/end around zfs_acl_chown_setattr 2021-02-27 22:29:50 +00:00
crypto armv8crypto: add missing newline 2021-02-28 16:03:55 -04:00
ddb ddb: just move cursor when the lexer backs up 2021-02-24 15:56:16 -08:00
dev pci_dw_mv: Don't enable unhandled interrupts. 2021-03-01 14:03:34 +01:00
dts Remove DTS files for arm boards we don't support 2021-01-27 10:02:01 +00:00
fs nfsclient: add nfs node locking around uses of n_direofoffset 2021-02-28 14:53:54 -08:00
gdb Use atomic loads/stores when updating td->td_state 2021-02-18 14:02:48 +00:00
geom opencrypto: Introduce crypto_dispatch_async() 2021-02-08 09:19:19 -05:00
gnu Remove the old dts imported tree. 2021-01-15 20:09:55 +01:00
i386 smbios: Move smbios driver out from x86 machdep code 2021-02-23 21:17:09 +00:00
isa sc(4) md bits: stop setting sc->kbd entirely 2019-12-30 02:07:55 +00:00
kern jail: allow root to implicitly widen its cpuset to attach 2021-03-01 12:38:31 -06:00
kgssapi opencrypto: Introduce crypto_dispatch_async() 2021-02-08 09:19:19 -05:00
libkern Restore the augmented strlen commentary 2021-02-08 19:15:21 +00:00
mips [ar71xx] Fix routerstation / routerstation pro redboot FIS probing 2021-02-25 13:14:55 -08:00
modules smbios: Move smbios driver out from x86 machdep code 2021-02-23 21:17:09 +00:00
net bridgestp: Ensure we send STP on VLAN interfaces 2021-02-25 10:16:25 +01:00
net80211 net80211: rx_stats add 160Mhz channel width. 2021-02-28 19:24:22 +00:00
netgraph netgraph/ng_bridge: Add counters for the first link, too 2021-02-10 19:05:37 +01:00
netinet calculate prr_out correctly when pipe < ssthresh 2021-03-01 16:26:05 +01:00
netinet6 Fix crash with rtadv-originated multipath IPv6 routes. 2021-02-24 16:44:10 +00:00
netipsec Revert "SO_RERROR indicates that receive buffer overflows should be handled as errors." 2021-02-08 22:32:32 +00:00
netpfil pf: Fix incorrect fragment handling 2021-02-25 21:51:08 +01:00
netsmb net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
nfs nfs: clean up empty lines in .c and .h files 2020-09-01 21:25:39 +00:00
nfsclient nfs: clean up empty lines in .c and .h files 2020-09-01 21:25:39 +00:00
nfsserver nfs: Mark unused statistics variable as reserved 2020-11-18 04:35:49 +00:00
nlm nlm: clean up empty lines in .c and .h files 2020-09-01 22:14:52 +00:00
ofed ofed: quiet gcc -Wint-in-bool-context 2021-02-24 15:56:16 -08:00
opencrypto cryptosoft: Support per-op keys for AES-GCM and AES-CCM. 2021-02-18 09:53:25 -08:00
powerpc [PowerPC64LE] pseries: Fix input buffering logic. 2021-02-25 14:50:13 -06:00
riscv Add a VA_IS_CLEANMAP() macro. 2021-02-17 16:32:11 -08:00
rpc nfs-over-tls: handle res.gid.gid_val correctly for memory allocation 2021-01-12 13:59:52 -08:00
security Add a comment on why the call to mac_vnode_relabel() might be in the wrong 2021-02-27 16:25:26 +00:00
sys kcsan: add atomic_interrupt_fence 2021-03-01 07:43:27 +00:00
teken loader: implement framebuffer console 2021-01-02 21:41:36 +02:00
tests Enable running fib tests inside vnet jail. 2021-01-17 20:32:26 +00:00
tools syscalls.master: Add a new syscall type: RESERVED 2021-01-26 18:27:44 +00:00
ufs Call softdep_prealloc() before taking ffs_lock_ea(), if unlock is committing 2021-02-24 09:55:21 +02:00
vm vm pqbatch: move unmanaged page assert under pagequeue lock 2021-02-24 15:56:16 -08:00
x86 smbios: Move smbios driver out from x86 machdep code 2021-02-23 21:17:09 +00:00
xdr xdr: clean up empty lines in .c and .h files 2020-09-01 22:13:28 +00:00
xen xen: remove .swp file from public headers 2021-01-11 18:14:11 +01:00
Makefile Remove sparc64 kernel support 2020-02-03 17:35:11 +00:00