]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
kern: cpuset: allow jails to modify child jails' roots
authorKyle Evans <kevans@FreeBSD.org>
Sat, 19 Dec 2020 03:30:06 +0000 (03:30 +0000)
committerKyle Evans <kevans@FreeBSD.org>
Sat, 19 Dec 2020 03:30:06 +0000 (03:30 +0000)
commit54a837c8cca109ad0d7ecb4b93379086f6f49275
treeb25bafc4ef43df30c51f8757b7456fb41037fb04
parentdcc6f62526ad357f17fe030f6b9b4c3001add705
kern: cpuset: allow jails to modify child jails' roots

This partially lifts a restriction imposed by r191639 ("Prevent a superuser
inside a jail from modifying the dedicated root cpuset of that jail") that's
perhaps beneficial after r192895 ("Add hierarchical jails."). Jails still
cannot modify their own cpuset, but they can modify child jails' roots to
further restrict them or widen them back to the modifying jails' own mask.

As a side effect of this, the system root may once again widen the mask of
jails as long as they're still using a subset of the parent jails' mask.
This was previously prevented by the fact that cpuset_getroot of a root set
will return that root, rather than the root's parent -- cpuset_modify uses
cpuset_getroot since it was introduced in r327895, previously it was just
validating against set->cs_parent which allowed the system root to widen
jail masks.

Reviewed by: jamie
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D27352
sys/kern/kern_cpuset.c