Bug 2568071 (CVE-2026-135813) - CVE-2026-135813 qemu-kvm: qemu-kvm: guest-triggerable host heap over-read via vhost vring unmap after queue size change
Summary: CVE-2026-135813 qemu-kvm: qemu-kvm: guest-triggerable host heap over-read via...
Keywords:
Status: NEW
Alias: CVE-2026-135813
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-11-06 10:10 UTC by OSIDB Bzimport
Modified: 2026-11-24 09:07 UTC (History)
17 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2026-11-06 10:10:49 UTC
A flaw was found in the vhost vring unmap path of Red Hat Enterprise Linux's qemu-kvm (hw/virtio/vhost.c). vhost_virtqueue_start() maps the desc/avail/used rings and records their sizes (vq->desc_size/avail_size/used_size), but do_vhost_virtqueue_stop() and the error path of vhost_virtqueue_start() unmap the rings using the *current* virtio_queue_get_{desc,avail,used}_size() instead of the sizes recorded at map time. virtio_pci_common_write() accepts VIRTIO_PCI_COMMON_Q_SIZE writes on an enabled queue, and virtio_queue_set_num() only rejects sizes above 1024, so a privileged guest can resize a vhost queue between vhost start (DRIVER_OK) and stop (device reset).

If the guest places the used ring in a region that is not directly writable (for example the last 16 bytes of the BIOS flash ending at 4 GiB), address_space_map() returns a short heap bounce buffer sized to the mapped length. On stop, vhost_memory_unmap() passes the enlarged ring size as access_len, and address_space_unmap() copies access_len bytes from the bounce buffer into guest memory without clamping to the buffer length. With the queue resized from 1 to 1024 and VIRTIO_RING_F_EVENT_IDX negotiated, 8198 bytes are copied from a 14-byte heap buffer: the first 16 bytes land in flash MMIO and the remaining 8182 bytes of host heap contents are written to guest RAM at 4 GiB where the guest can read them. The leak is repeatable once per device reset cycle.

Impact: information disclosure of qemu process heap memory to the guest (glibc malloc metadata, heap, qemu and libc pointers - defeats ASLR and aids exploitation of other qemu flaws). The guest cannot write to qemu process memory through this path. Configurations with a vhost IOMMU (VIRTIO_F_IOMMU_PLATFORM) are not affected: the mapping is an identity mapping and unmap is a no-op. Only the used-ring write-back is exploitable; the desc/avail unmaps perform no write-back.

Introduced upstream in qemu 2.10 (commit c471ad0e, vhost_net: device IOTLB support, 2017). Fixed incidentally upstream in v11.1.0 by the vhost vrings map/unmap refactoring, which unmaps with the sizes recorded at map time:
- 060ef8cac115 vhost: simplify calls to vhost_memory_unmap()
- 4e61c89262aa vhost: final refactoring of vhost vrings map/unmap
- c85f42703df6 vhost: vhost_virtqueue_start(): fix failure path
None of these commits describe the security impact, and no CVE has been assigned or requested upstream. The reporter also filed the issue upstream as confidential work item https://gitlab.com/qemu-project/qemu/-/issues/4802 (2026-11-04).

Affected Red Hat streams (verified by source inspection of the corresponding upstream bases and, where noted, by the reporter's tests against RHEL binaries):
- rhel-8 (qemu-kvm-6.2.0, RHEL 8.10) - affected; reporter reproduced on the Rocky Linux 8.10 rebuild
- rhel-9.2 (qemu-kvm 7.2.0 base) - affected
- rhel-9.6 (qemu-kvm 9.1.0 base) - affected
- rhel-9.8 (qemu-kvm-10.1.0-17.el9_8.9) - affected; same code verified in CentOS Stream 9 sources (10.1.0-26)
- rhel-10.0 (qemu-kvm 9.1.0 base) - affected
- rhel-10.2 (qemu-kvm-10.1.0-16.el10_2.5) - affected; reporter reproduced
- CentOS Stream 9 (qemu-kvm-10.1.0-26.el9) - affected (verified)
- CentOS Stream 10 (qemu-kvm-11.1.0) - not affected (contains the upstream fix)

Minimal downstream fix: in do_vhost_virtqueue_stop() and the error path of vhost_virtqueue_start() (hw/virtio/vhost.c), unmap with the stored vq->used_size/avail_size/desc_size instead of virtio_queue_get_{used,avail,desc}_size(vdev, idx); this is the downstream equivalent of upstream 060ef8cac115. Suggested hardening: clamp access_len to the bounce buffer length in address_space_unmap() (system/physmem.c), and reject VIRTIO_PCI_COMMON_Q_SIZE writes on an enabled queue. Related but separate: upstream commit d530f2dfbd2d (virtio: fix queue size validation against allocated maximum, CVE-2026-50626) is not present in RHEL streams; it caps guest queue sizes at the device default and would only shrink this leak (a 1->128 resize on vhost-vsock still leaks 1014 bytes).

Reported by green via PSIRTSUPT-30008 on 2026-11-05, with a qtest-based reproducer (vring-unmap-repro.c) covering vhost-vsock-pci and vhost-net on tap. Red Hat verified the flaw by static analysis of the affected sources (upstream v6.2.0, v7.2.0, v9.1.0, v10.1.0 and CentOS Stream 9); the reproducer was not executed.


Note You need to log in before you can comment on or make changes to this bug.