Page MenuHomeFreeBSD

cpuset_set{affinity,domain}: do not allow empty masks
ClosedPublic

Authored by kevans on Dec 8 2020, 2:29 PM.
Tags
None
Referenced Files
F108098911: D27511.id80440.diff
Tue, Jan 21, 9:15 AM
Unknown Object (File)
Sat, Jan 18, 9:44 PM
Unknown Object (File)
Sat, Jan 18, 7:35 AM
Unknown Object (File)
Wed, Jan 8, 1:52 AM
Unknown Object (File)
Wed, Jan 8, 12:41 AM
Unknown Object (File)
Thu, Jan 2, 3:20 AM
Unknown Object (File)
Thu, Jan 2, 1:56 AM
Unknown Object (File)
Tue, Dec 24, 12:51 PM
Subscribers

Details

Summary

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.

Reported by: syzbot+4e3b1009de98d2fabcda@syzkaller.appspotmail.com

Test Plan

I could not reproduce this one from syzbot's repro, but it's clear that it is a problem

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 35255