Guest-to-host escape

A QEMU guest escapes by corrupting the QEMU process on the host, which emulates the VM's devices while KVM accelerates the CPU. The reachable surface is QEMU's device models: virtio devices, emulated NICs, USB controllers, block and SCSI controllers, audio devices, and the legacy floppy controller, each parsing guest-driven register writes and DMA descriptors.

1 min di letturaaggiornato il 7 ott 2026florianamette1 contributore
Chiedi al tuo assistente (MCP)Modifica su GitHub

QEMU provides the device emulation for a KVM virtual machine while the KVM kernel module accelerates CPU and memory virtualization. A guest cannot touch the host CPU path, so escapes target the QEMU user-space process: its device models read guest-driven I/O (port and MMIO register writes) and walk DMA descriptors and ring buffers the guest places in its own memory. A memory-safety flaw in any device model yields code execution in the QEMU process, which runs on the host with the privileges of whoever launched the VM (often reduced by seccomp and sometimes confined, but still a host process). Because the device models are shared, these bugs recur across every KVM-based product.

bash
# from the guest: enumerate the emulated devices (the escape surface)
lspci -nn                       # virtio, e1000/rtl8139, USB controllers, audio
lsusb; cat /proc/ioports        # I/O-port devices incl. the legacy floppy (0x3f0-)
dmesg | grep -i virtio

Subtopics#

References#