Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162734611
D21477.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D21477.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D21477: cpuset_setdomain(2): Ensure that the set is a subset of all_domains.
Attached
Detach File
Event Timeline
Log In to Comment