diff --git a/usr.sbin/jail/jail.c b/usr.sbin/jail/jail.c index 920e573b914..eaef6d00424 100644 --- a/usr.sbin/jail/jail.c +++ b/usr.sbin/jail/jail.c @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -131,6 +132,16 @@ static const enum intparam stopcommands[] = { IP__NULL }; +static void +reset_cpuset(void) +{ + cpusetid_t setid; + + if (cpuset_getid(CPU_LEVEL_ROOT, CPU_WHICH_TID, -1, &setid) != 0) + return; + (void)cpuset_setid(CPU_WHICH_PID, -1, setid); +} + int main(int argc, char **argv) { @@ -363,6 +374,9 @@ main(int argc, char **argv) exit(1); } + if ((op & (JF_START | JF_STOP)) != 0) + reset_cpuset(); + jfp = NULL; if (JidFile != NULL) { jfp = fopen(JidFile, "w");