In the Linux kernel, the following vulnerability has been resolved:
vdpa_sim_blk: reject out-of-range sector starts
vdpasim_blk_check_range() logs an invalid start sector but continues
validating the request. The subsequent unsigned capacity subtraction can
underflow and let an out-of-range buffer offset reach the data path.
The invalid offset is used by three request paths. VIRTIO_BLK_T_OUT
copies guest data to blk->buffer + offset through
vringh_iov_pull_iotlb(), causing an out-of-bounds write in
_copy_from_iter() or memcpy(). VIRTIO_BLK_T_IN copies from
blk->buffer + offset to the guest through vringh_iov_push_iotlb(),
causing an out-of-bounds read in _copy_to_iter().
VIRTIO_BLK_T_WRITE_ZEROES passes blk->buffer + offset to memset(),
causing an out-of-bounds write.
Reject starts at or beyond the capacity before the subtraction. Treat the
capacity boundary as invalid because the IN and OUT paths round byte counts
down to sectors for validation but later copy the original byte counts. A
sub-sector request at the capacity boundary would otherwise still access
past the end of the buffer.
I found this bug myself, though the patch was written with AI assistance.
CVSS Vector: CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H
CVSS Score: 7.8
AV:L - The bad value is virtio_blk_outhdr.sector, written into the virtqueue by the virtio driver. That driver is a guest VM using the device through vhost-vdpa, or a local process with access to /dev/vhost-vdpa-N. vdpasim_blk_handle_req() reads it with vringh_getdesc_iotlb()/vringh_iov_pull_iotlb(). No network protocol carries it.
AC:H - The code needs a vdpa_sim_blk device, a test simulator that root must create with VDPA_CMD_DEV_NEW (GENL_ADMIN_PERM) and bind to vhost-vdpa for a VM. The attacker cannot set that up. Once it exists, a single request with a large sector fires the bug every time.
PR:L - The attacker needs control of the virtqueue driver, for example the guest kernel of a VM that was given the device, or a user granted the vhost-vdpa char device. That is ordinary tenant privilege, not host root.
UI:N - Once the device is assigned, the attacker posts the request on their own virtqueue and the simulator's work function runs vdpasim_blk_handle_req() with no host-side action.
S:C - The driver of the device (usually a guest VM) corrupts or reads host kernel memory outside blk->buffer. That crosses from the guest's authority into the host kernel's, a guest-to-host boundary.
C:H - VIRTIO_BLK_T_IN with an out-of-range sector makes vringh_iov_push_iotlb() copy from blk->buffer + (sector << 9). The attacker picks that offset from the kvzalloc buffer, and the host kernel memory is returned into the attacker's own descriptors.
I:H - VIRTIO_BLK_T_OUT makes vringh_iov_pull_iotlb() copy attacker data to blk->buffer + offset, and WRITE_ZEROES memsets there. The offset is under attacker control, which gives a write into host kernel memory that can lead to code execution.
A:H - A write or read at a wild offset hits unmapped or critical host memory and oopses or panics the host kernel. That also takes down every other VM on the host.
| Attack Vector |
Local |
Scope |
Changed |
| Attack Complexity |
High |
Confidentiality Impact |
High |
| Privileges Required |
Low |
Integrity Impact |
High |
| User Interaction |
None |
Availability Impact |
High |
AV:L - The bad value is virtio_blk_outhdr.sector, written into the virtqueue by the virtio driver. That driver is a guest VM using the device through vhost-vdpa, or a local process with access to /dev/vhost-vdpa-N. vdpasim_blk_handle_req() reads it with vringh_getdesc_iotlb()/vringh_iov_pull_iotlb(). No network protocol carries it.
AC:H - The code needs a vdpa_sim_blk device, a test simulator that root must create with VDPA_CMD_DEV_NEW (GENL_ADMIN_PERM) and bind to vhost-vdpa for a VM. The attacker cannot set that up. Once it exists, a single request with a large sector fires the bug every time.
PR:L - The attacker needs control of the virtqueue driver, for example the guest kernel of a VM that was given the device, or a user granted the vhost-vdpa char device. That is ordinary tenant privilege, not host root.
UI:N - Once the device is assigned, the attacker posts the request on their own virtqueue and the simulator's work function runs vdpasim_blk_handle_req() with no host-side action.
S:C - The driver of the device (usually a guest VM) corrupts or reads host kernel memory outside blk->buffer. That crosses from the guest's authority into the host kernel's, a guest-to-host boundary.
C:H - VIRTIO_BLK_T_IN with an out-of-range sector makes vringh_iov_push_iotlb() copy from blk->buffer + (sector << 9). The attacker picks that offset from the kvzalloc buffer, and the host kernel memory is returned into the attacker's own descriptors.
I:H - VIRTIO_BLK_T_OUT makes vringh_iov_pull_iotlb() copy attacker data to blk->buffer + offset, and WRITE_ZEROES memsets there. The offset is under attacker control, which gives a write into host kernel memory that can lead to code execution.
A:H - A write or read at a wild offset hits unmapped or critical host memory and oopses or panics the host kernel. That also takes down every other VM on the host.
CVSS 3.1