freebsd-skq/lib/libc/tests/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
..
brk_test.c Reimplement brk() and sbrk() to avoid the use of _end. 2018-06-04 19:35:15 +00:00
cpuset_test.c jail: allow root to implicitly widen its cpuset to attach 2021-03-01 12:38:31 -06:00
Makefile libc: tests: add some tests for cpuset(2) 2020-12-31 12:31:54 -06:00
Makefile.depend
mlock_helper.c Provide separate accounting for user-wired pages. 2019-05-13 16:38:48 +00:00
queue_test.c
sendfile_test.c Pass a valid mode with O_CREATE to open(2). 2020-09-02 21:17:54 +00:00