Problem Description:
Several vulnerabilities were found in the ctl subsystem.
The function ctl_write_buffer incorrectly set a flag which resulted
in a kernel Use-After-Free when a command finished processing
(CVE-2024-45063). The ctl_write_buffer and ctl_read_buffer functions
allocated memory to be returned to userspace, without initializing
it (CVE-2024-8178). The ctl_report_supported_opcodes function did
not sufficiently validate a field provided by userspace, allowing
an arbitrary write to a limited amount of kernel help memory
(CVE-2024-42416). The ctl_request_sense function could expose up
to three bytes of the kernel heap to userspace (CVE-2024-43110).
Guest virtual machines in the bhyve hypervisor can send SCSI commands
to the corresponding kernel driver via the virtio_scsi interface.
This provides guests with direct access to the vulnerabilities
covered by this advisory.
The CAM Target Layer iSCSI target daemon ctld(8) accepts incoming
iSCSI connections, performs authentication and passes connections
to the kernel ctl(4) target layer.
Impact:
Malicious software running in a guest VM that exposes virtio_scsi
can exploit the vulnerabilities to achieve code execution on the
host in the bhyve userspace process, which typically runs as root.
Note that bhyve runs in a Capsicum sandbox, so malicious code is
constrained by the capabilities available to the bhyve process.
A malicious iSCSI initiator could achieve remote code execution on
the iSCSI target host.