freebsd-src/lib/libc
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
..
aarch64 Fix initial exec TLS mode for dynamically loaded shared objects. 2019-03-29 17:52:57 +00:00
amd64 amd64: import asm strlen into libc 2021-02-23 00:09:55 +00:00
arm Remove obsolete code gated on _ARM_ARCH_* 2021-01-28 10:41:45 +00:00
capability Fix a few mandoc issues 2020-10-09 19:12:44 +00:00
compat-43 Adjust history, info source from v1's manuals 2019-09-04 13:44:46 +00:00
db Remove the SYMVER build option. 2020-04-30 22:08:40 +00:00
gdtoa Remove sparc64 specific parts of libc. 2020-02-26 18:55:09 +00:00
gen s_scalbn.c: Add missing float.h include 2021-03-01 14:22:47 +00:00
gmon mcount: tidy up ANSIfication 2018-10-20 22:39:35 +00:00
i386 remove obsolete i386 MD memchr implementation 2019-09-25 16:49:22 +00:00
iconv Remove the SYMVER build option. 2020-04-30 22:08:40 +00:00
include libthr: wrap pdfork(2), same as fork(2). 2021-01-11 22:59:52 +02:00
inet libc: fix cases of undefined behavior. 2018-08-07 15:24:19 +00:00
isc SPDX: more ISC-related files. 2017-12-08 17:52:53 +00:00
locale Remove __NO_TLS. 2021-02-23 20:08:10 +02:00
md
mips mips: fix some mcount nits 2019-09-02 01:55:55 +00:00
nameser Bounds check again after advancing cp, otherwise we have a possible 2019-09-05 19:35:30 +00:00
net libc: Fix most issues reported by mandoc 2020-12-19 14:54:28 +00:00
nls Implement strerror_l(). 2020-12-16 09:02:09 +00:00
posix1e Drop "All rights reserved" from all my stuff. This includes 2020-10-28 13:46:11 +00:00
powerpc [PowerPC] [PowerPCSPE] Fix multiple issues in fpsetmask(). 2021-02-28 21:11:29 -06:00
powerpc64 [PowerPC64] Fix multiple issues in fpsetmask(). 2021-02-28 20:37:48 -06:00
powerpcspe [PowerPC] [PowerPCSPE] Fix multiple issues in fpsetmask(). 2021-02-28 21:11:29 -06:00
quad Add casts and L suffixes to libc quad support, to work around various 2020-02-17 20:14:59 +00:00
regex libc: regex: rework unsafe pointer arithmetic 2021-01-08 13:58:35 -06:00
resolv Rather than using the legacy IP struct fields in the union for the 2019-06-04 20:53:35 +00:00
riscv riscv: Fix whitespace issues in fabs added in 524b018d20 2021-03-01 15:19:36 +00:00
rpc libc: fix buffer overrun in getrpcport(3) 2021-01-31 21:42:02 +00:00
secure Remove the SYMVER build option. 2020-04-30 22:08:40 +00:00
softfloat Add implementations for clog(3), clogf(3), and clog(3). 2018-05-13 09:54:34 +00:00
stdio libc: try to skip memcpy in _gettemp 2021-01-24 11:06:36 +00:00
stdlib libc/qsort: Don't allow interposing recursive calls 2021-02-18 14:02:48 +00:00
stdtime strptime: make %k and %l specifiers match their description in 2018-11-03 23:37:13 +00:00
string Remove __NO_TLS. 2021-02-23 20:08:10 +02:00
sys pwrite(2): add a BUGS section 2021-02-20 08:05:43 +00:00
tests jail: allow root to implicitly widen its cpuset to attach 2021-03-01 12:38:31 -06:00
uuid libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
x86 x86: switch vdso TSC timecounter to RDTSCP on AMD Zen CPUs 2021-01-21 14:55:31 +02:00
xdr typo: s/impelmentation/implementation/. 2020-02-07 15:14:29 +00:00
yp Increase the size of the send and receive buffers for YP client rpc 2019-09-16 06:42:01 +00:00
libc.ldscript
libc_nossp.ldscript
Makefile [PowerPC64LE] Use a shared LIBC_ARCH for powerpc64le. 2020-09-23 00:21:51 +00:00
Makefile.depend Update Makefile.depend files 2019-12-11 17:37:53 +00:00
Makefile.depend.options Update libssp paths in various Makefile.depend* files 2020-01-06 18:15:55 +00:00
Versions.def Create namespace for the symbols added during 13-CURRENT cycle. 2018-11-12 19:12:14 +00:00