]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r368462: cpuset_set{affinity,domain}: do not allow empty masks
authorKyle Evans <kevans@FreeBSD.org>
Tue, 15 Dec 2020 21:53:15 +0000 (21:53 +0000)
committerKyle Evans <kevans@FreeBSD.org>
Tue, 15 Dec 2020 21:53:15 +0000 (21:53 +0000)
commit21d35411c119c694f333b979334ae119852caa49
tree8cad84786d0cd6bbd0820e13eb791be50ce78da7
parent878170c334dfd246835f9a8baf7a579817a02b30
MFC r368462: cpuset_set{affinity,domain}: do not allow empty masks

cpuset_modify() would not currently catch this, because it only checks that
the new mask is a subset of the root set and circumvents the EDEADLK check
in cpuset_testupdate().

This change both directly validates the mask coming in since we can
trivially detect an empty mask, and it updates cpuset_testupdate to catch
stuff like this going forward by always ensuring we don't end up with an
empty mask.

The check_mask argument has been renamed because the 'check' verbiage does
not imply to me that it's actually doing a different operation. We're either
augmenting the existing mask, or we are replacing it entirely.
sys/kern/kern_cpuset.c