FreeBSD Bugzilla – Attachment 219867 Details for
Bug 240687
jail cpuset masks cannot be expanded
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
git(1) diff against base
cpuset-jail.diff (text/plain), 1.43 KB, created by
Kyle Evans
on 2020-11-21 21:20:13 UTC
(
hide
)
Description:
git(1) diff against base
Filename:
MIME Type:
Creator:
Kyle Evans
Created:
2020-11-21 21:20:13 UTC
Size:
1.43 KB
patch
obsolete
>commit 2f072d7865b3c4cf16856ef4e43df573cc27a1e6 >Author: Kyle Evans <kevans@FreeBSD.org> >Date: Sat Nov 21 13:37:58 2020 -0600 > > Allow non-jailed root to adjust jail cpusets > >diff --git a/sys/kern/kern_cpuset.c b/sys/kern/kern_cpuset.c >index 6130dd32ed4..bb4614f57c9 100644 >--- a/sys/kern/kern_cpuset.c >+++ b/sys/kern/kern_cpuset.c >@@ -674,20 +674,29 @@ cpuset_modify(struct cpuset *set, cpuset_t *mask) > if (error) > return (error); > /* >- * In case we are called from within the jail >+ * In case we are called from within the jail, > * we do not allow modifying the dedicated root > * cpuset of the jail but may still allow to >- * change child sets. >+ * change child sets, including subordinate jails' >+ * roots. > */ >- if (jailed(curthread->td_ucred) && >- set->cs_flags & CPU_SET_ROOT) >+ if ((set->cs_flags & CPU_SET_ROOT) != 0 && >+ jailed(curthread->td_ucred) && >+ set == curthread->td_ucred->cr_prison->pr_cpuset) > return (EPERM); > /* > * Verify that we have access to this set of > * cpus. > */ >- root = cpuset_getroot(set); > mtx_lock_spin(&cpuset_lock); >+ if ((set->cs_flags & (CPU_SET_ROOT | CPU_SET_RDONLY)) == CPU_SET_ROOT) { >+ KASSERT(set->cs_parent != NULL, >+ ("jail.cpuset=%d is not a proper child of parent jail's root.", >+ set->cs_id)); >+ root = cpuset_getroot(set->cs_parent); >+ } else { >+ root = cpuset_getroot(set); >+ } > if (root && !CPU_SUBSET(&root->cs_mask, mask)) { > error = EINVAL; > goto out;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 240687
: 219867