CVE-2026-97991: vdpa_sim_blk: reject out-of-range sector starts
In the Linux kernel, the following vulnerability has been resolved:
vdpasimblk: reject out-of-range sector starts
vdpasimblkcheckrange() 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. VIRTIOBLKTOUT copies guest data to blk->buffer + offset through vringhiovpulliotlb(), causing an out-of-bounds write in copyfromiter() or memcpy(). VIRTIOBLKTIN copies from blk->buffer + offset to the guest through vringhiovpushiotlb(), causing an out-of-bounds read in copytoiter(). VIRTIOBLKTWRITEZEROES 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.
Affected Software
Event History
Frequently Asked Questions
Which request types can trigger the out-of-bounds access?
The affected paths are VIRTIO_BLK_T_OUT, VIRTIO_BLK_T_IN, and VIRTIO_BLK_T_WRITE_ZEROES. OUT and WRITE_ZEROES can write beyond the backing buffer, while IN can read beyond it.
What input is required to exploit the issue?
A request must specify a starting sector at or beyond the device capacity. Sub-sector requests at the capacity boundary are also unsafe because validation rounds byte counts down to sectors while later operations use the original byte count.
How can the issue be mitigated before applying the fix?
Reject block requests whose starting sector is at or beyond the configured capacity, including requests beginning exactly at the capacity boundary. This prevents the unsigned capacity subtraction from underflowing and producing an invalid buffer offset.