vhost/vdpa: validate virtqueue index in mmap and fault paths
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ ddd89d0a059d8e9740c75a97e0efe9bf07ee51f9 · < 1f5f94c6c6b2e4eaa5b45815509e21d0c6cfa81e| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
vhost/vdpa: validate virtqueue index in mmap and fault paths
vhost_vdpa_mmap() and vhost_vdpa_fault() use vma->vm_pgoff as a virtqueue index for get_vq_notification(), but they do not validate that the index is smaller than v->nvqs.
The ioctl path already performs both a bounds check and array_index_nospec(), but the mmap/fault path only checks that the index fits in u16. This allows an out-of-range queue index to reach driver-specific get_vq_notification() callbacks.
Fix this by extracting a unified vhost_vdpa_get_vq_notification() helper that validates the queue index against v->nvqs and applies array_index_nospec() before calling the driver callback. Both the mmap and fault paths use this helper, and the bounds checking is consolidated into a single location.
From source inspection, the most defensible impact is out-of-bounds access in the callback path, potentially leading to invalid PFN remaps and crash/DoS.
From the CVE record · Linux
The Linux kernel’s vhost/vdpa mmap and fault paths do not check whether a virtqueue index is within range before passing it to a driver callback. A local user able to access the vhost/vdpa interface may trigger out-of-bounds access, potentially causing invalid PFN remaps or a crash. Authentication requirements are not specified.
Engineers running Linux kernels with vhost/vdpa should check whether their kernel includes the fix; affected versions were not provided.