Page MenuHomeFreeBSD

D21477.diff
No OneTemporary

D21477.diff

Index: head/sys/kern/kern_cpuset.c
===================================================================
--- head/sys/kern/kern_cpuset.c
+++ head/sys/kern/kern_cpuset.c
@@ -2156,6 +2156,14 @@
DOMAINSET_COPY(mask, &domain.ds_mask);
domain.ds_policy = policy;
+ /*
+ * Sanitize the provided mask.
+ */
+ if (!DOMAINSET_SUBSET(&all_domains, &domain.ds_mask)) {
+ error = EINVAL;
+ goto out;
+ }
+
/* Translate preferred policy into a mask and fallback. */
if (policy == DOMAINSET_POLICY_PREFER) {
/* Only support a single preferred domain. */
@@ -2165,12 +2173,12 @@
}
domain.ds_prefer = DOMAINSET_FFS(&domain.ds_mask) - 1;
/* This will be constrained by domainset_shadow(). */
- DOMAINSET_FILL(&domain.ds_mask);
+ DOMAINSET_COPY(&all_domains, &domain.ds_mask);
}
/*
- * When given an impossible policy, fall back to interleaving
- * across all domains
+ * When given an impossible policy, fall back to interleaving
+ * across all domains.
*/
if (domainset_empty_vm(&domain))
domainset_copy(&domainset2, &domain);

File Metadata

Mime Type
text/plain
Expires
Fri, Jul 17, 7:36 AM (18 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35161469
Default Alt Text
D21477.diff (1 KB)

Event Timeline