Page MenuHomeFreeBSD

vmm: Fix VM_GET_CPUS compatibility
ClosedPublic

Authored by markj on Aug 17 2023, 7:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
May 21 2024, 4:45 AM
Unknown Object (File)
Apr 26 2024, 6:32 AM
Unknown Object (File)
Apr 26 2024, 5:59 AM
Unknown Object (File)
Apr 25 2024, 9:52 PM
Unknown Object (File)
Dec 20 2023, 7:23 AM
Unknown Object (File)
Dec 12 2023, 7:39 AM
Unknown Object (File)
Oct 14 2023, 3:46 PM
Unknown Object (File)
Sep 18 2023, 5:31 PM
Subscribers

Details

Summary

bhyve in a 13.x jail fails to boot guests with more than one vCPU
because they pass too small a buffer to VM_GET_CPUS, causing the ioctl
handler to return ERANGE. Handle this the same way as cpuset system
calls: make sure that the result can fit in the truncated space, and
relax the check on the cpuset buffer.

As a side effect, fix an insufficient bounds check on "size". The
signed/unsigned comparison with sizeof(cpuset_t) fails to exclude
negative values, so we can end up allocating impossibly large amounts of
memory.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable