Linux: vhost: invalidate vring access on IOTLB transitions
What fixes it
- 021bf73731f7aa94540a549cf850db5968019960LinuxCVE List
- 7f8ee0b8f632441aec456a7c147fb43f5c73542dLinuxCVE List
- 4a454af8e56c1596ada1421ae5eba90c8896c7c7LinuxCVE List
A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.
Description
In the Linux kernel, the following vulnerability has been resolved:
vhost: invalidate vring access on IOTLB transitions
When VIRTIO_F_ACCESS_PLATFORM changes, cached vring pointers and IOTLB metadata are interpreted in a different address space. Keeping them across the transition can leave stale ring mappings in use.
Clearing d->iotlb before taking the VQ locks also lets a worker observe a transient NULL d->iotlb and fall back to d->umem while translating a descriptor.
Add a common vhost_clear_device_iotlb() helper for vhost-net and vhost-vsock. Take all VQ mutexes in index order before dropping the device-wide IOTLB, invalidate each VQ's cached ring access and metadata, clear pending IOTLB messages, and free the old table after the handoff. This serializes the transition with workers and prevents mixed address space mappings.
On the first direct-to-IOTLB transition, invalidate the cached vring addresses. When an existing device IOTLB is replaced, preserve the GIOVA ring addresses and reset only the metadata cache. After clearing ACCESS_PLATFORM, userspace must configure the vring addresses for the new address mode.
vhost_vq_invalidate_access() clears desc, avail, and used together. Treat the VQ as invalidated only when all three are NULL, since a single GIOVA address may legitimately be zero.
Text from CVE List
Affected versions 12
- Linuxaffected: 6b1e6cc7855b09a0a9bfa1d9f30172ba366f161c before 021bf73731f7aa94540a549cf850db5968019960CVE List
- Linuxaffected: 6b1e6cc7855b09a0a9bfa1d9f30172ba366f161c before e8fe13c14d57cc7c6bd69c72c5fabaaf0d918f98CVE List
- Linuxaffected: 6b1e6cc7855b09a0a9bfa1d9f30172ba366f161c before 7f8ee0b8f632441aec456a7c147fb43f5c73542dCVE List
- Linuxaffected: 6b1e6cc7855b09a0a9bfa1d9f30172ba366f161c before 4a454af8e56c1596ada1421ae5eba90c8896c7c7CVE List
- Linuxaffected: 6b1e6cc7855b09a0a9bfa1d9f30172ba366f161c before e4f4761879a230aa59e569102a6ab9851847d833CVE List
- Linuxaffected: 4.8CVE List
- Linuxunaffected: all versions before 4.8CVE List
- Linuxunaffected: 6.6.160 through 6.6.*CVE List
- Linuxunaffected: 6.12.114 through 6.12.*CVE List
- Linuxunaffected: 6.18.57 through 6.18.*CVE List
- Linuxunaffected: 7.2.7 through 7.2.*CVE List
- Linuxunaffected: 7.3CVE List
References 5
- git.kernel.org/stable/c/021bf73731f7aa94540a549cf850db5968019960Referencevia CVE List
- git.kernel.org/stable/c/e8fe13c14d57cc7c6bd69c72c5fabaaf0d918f98Referencevia CVE List
- git.kernel.org/stable/c/7f8ee0b8f632441aec456a7c147fb43f5c73542dReferencevia CVE List
- git.kernel.org/stable/c/4a454af8e56c1596ada1421ae5eba90c8896c7c7Referencevia CVE List
- git.kernel.org/stable/c/e4f4761879a230aa59e569102a6ab9851847d833Referencevia CVE List