Page MenuHomeFreeBSD

cpuset_setdomain(2): Ensure that the set is a subset of all_domains.
ClosedPublic

Authored by markj on Aug 30 2019, 8:24 PM.
Tags
None
Referenced Files
F136933296: D21477.id.diff
Thu, Nov 20, 5:46 PM
F136932384: D21477.id61538.diff
Thu, Nov 20, 5:41 PM
F136932148: D21477.id61491.diff
Thu, Nov 20, 5:39 PM
F136930664: D21477.diff
Thu, Nov 20, 5:27 PM
Unknown Object (File)
Tue, Oct 28, 7:38 PM
Unknown Object (File)
Tue, Oct 28, 5:55 PM
Unknown Object (File)
Wed, Oct 22, 9:51 PM
Unknown Object (File)
Wed, Oct 22, 9:51 PM
Subscribers

Details

Summary

Userspace is allowed to provide a mask of up to 256 bits. In the
kernel, the domain mask is 64 bits wide even though MAXMEMDOM is 8.
cpuset_setdomain() returns EINVAL if any bits beyond the first 64 are
set; go further and return an error if any bits outside of
all_domains are set.

domainset_empty_vm() assumes that the input set is a subset of
all_domains, since it iterates over the set and populates the ds_order
table. The problem became more noticeable after r351547.

We could instead silently mask off bits that are not present in
all_domains. However, since we already check for domain IDs >= 64
and return EINVAL if any are present, I don't see why we should
be inconsistent for domain IDs < 64.

Test Plan

Peter reported the bug and tested an earlier version of the patch.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 26197
Build 24702: arc lint + arc unit