CVE-2026-97991 PUBLISHED

vdpa_sim_blk: reject out-of-range sector starts

Assigner: Linux
Reserved: 25.09.2026 Published: 25.09.2026 Updated: 25.09.2026

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.

Metrics

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.

Product Status

Vendor Linux
Product Linux
Versions Default: unaffected
  • affected from 7d189f617f83f780915b737896a696ff605bd19f to 14acb0d44b7d90a077beb7b92b444b90bafda9d9 (excl.)
  • affected from 7d189f617f83f780915b737896a696ff605bd19f to a8a1413a2cfdbedc896249f461d6d92efbbfe21f (excl.)
  • affected from 7d189f617f83f780915b737896a696ff605bd19f to d6dac17e20fd2abd0eb8c09d69fccf7426e12bcf (excl.)
  • affected from 7d189f617f83f780915b737896a696ff605bd19f to 0a8693f00c408d85f086ad85d29e7030bf1e2055 (excl.)
Vendor Linux
Product Linux
Versions Default: affected
  • Version 5.13 is affected
  • unaffected from 0 to 5.13 (excl.)
  • unaffected from 6.12.111 to 6.12.* (incl.)
  • unaffected from 6.18.53 to 6.18.* (incl.)
  • unaffected from 7.2.7 to 7.2.* (incl.)
  • unaffected from 7.3-rc3 to * (incl.)

References