This episode dissects the virtual I/O layer: how virtio ring buffers and packed virtio work, virtio-iommu as a paravirtualized IOMMU, and Landlock and seccomp sandboxing that secure the host from the VMM. You'll also learn device limitations and why each of these layers is crucial for VM security.

After migration and snapshot in episodes 10-11, now we descend to the most fundamental layer: how data actually flows between guest and host. In episode 12 we dissect virtio technically — ring buffers, packed virtio, and virtio-iommu — then see how Cloud Hypervisor protects itself from a malicious guest with Landlock and seccomp sandboxing.
An analogy: virtio is the traffic bridge between the guest and its devices, and the IOMMU is the security guard making sure every vehicle (DMA) only reaches legitimate destinations. Without the guard, a guest could exploit a driver bug to access host memory — that's why this layer can't be taken lightly.
Virtio devices communicate through a virtqueue: one or more ring buffers shared between guest and host through the same memory. The ring contains descriptors that point to data buffers:
Because the ring buffer lives in shared memory, there's no context-switch cost per I/O — that's the secret of virtio's efficiency. The guest marks new work by writing to a queue notification (and triggering a VM-exit); the host marks completion with an interrupt.
The classic ring version (split virtqueue) uses several separate structures (descriptors, available ring, used ring) — that's a lot of cache lines that must be kept in sync. Packed virtio combines everything into one compact structure. The result: fewer cache misses and reduced notifications/interrupts, boosting throughput on high-I/O workloads.
cloud-hypervisor \
--kernel kernel-vmlinux \
--disk path=os.raw \
--net tap=ch0,ip=192.168.100.1,packed=true \
--cpus boot=4 \
--memory size=4Gpacked=true on --net enables the packed virtqueue. In the guest, confirm the negotiated features:
ethtool -k enp0s2 | grep -i virtio
lspci -vv -s $(lspci | grep virtio-net | awk '{print $1}') | grep -i "virtio version"Without protection, a buggy or compromised guest driver could point DMA at host physical memory addresses — a serious threat to VM isolation. The VMM protects the host with an emulated IOMMU or, for passthrough, a hardware IOMMU. But there's a much lighter paravirtualized option: virtio-iommu.
Virtio-iommu provides DMA translation at the device level: the guest requests IOVA (I/O Virtual Address) mappings to physical addresses, and the VMM only allows mappings to legitimate memory. This is granular per-device isolation:
cloud-hypervisor \
--kernel kernel-vmlinux \
--disk path=os.raw \
--iommu \
--cpus boot=4 \
--memory size=4G--iommu routes virtio devices through virtio-iommu. In the guest, devices now appear behind an IOMMU group:
ls /sys/kernel/iommu_groups/Note
Virtio-iommu isn't a replacement for a hardware IOMMU for physical device passthrough. It adds an isolation layer for virtual devices — both to protect the host from a compromised device and to prepare for safer device-sharing scenarios.
The VMM is a highly privileged process on the host. If a guest manages to exploit the VMM (e.g., through a bug in the device model), it could execute code in host context. Two kernel mechanisms shrink the blast radius:
Landlock is an LSM (Linux Security Module) that restricts what a process may access in the filesystem, without needing to run the VMM inside a container. Cloud Hypervisor uses it to deny access to files beyond what it needs (kernel, disk, config) — even if the VMM is compromised, the exploit can't read other files on the host.
grep landlock /proc/self/status
uname -rLandlock is available in kernel 5.13+. Cloud Hypervisor enables it automatically when possible. The observable effect: the VMM can only open files actually provided via the CLI (kernel, disk, config), not the whole filesystem.
seccomp restricts the syscalls a process may call. Cloud Hypervisor applies a seccomp filter so only the syscalls the VMM needs are allowed. As a result, an exploit that tries dangerous syscalls (e.g., ptrace, mount, reboot) is rejected by the kernel with SIGSYS.
cat /proc/$(pgrep -f cloud-hypervisor)/status | grep SeccompSeccomp: 2 means filter mode is active (not 0 = disabled).
Besides process sandboxing, Cloud Hypervisor restricts which devices a guest can create. Only the devices provided in the configuration exist; the guest can't create new devices or access resources outside what's mapped. This is the principle of least privilege applied to the device model.
Warning
Sandboxing reduces the impact of exploits, it doesn't eliminate them. The right combination: a always-patched host kernel, the latest VMM version (CVE fixes), active Landlock + seccomp, and trusted guest images. No single layer can be ignored (we continue in episode 13).
packed=true with old guest drivers: old drivers may not support packed virtio; negotiation falls back to classic mode automatically, but verify the features in the guest.--iommu without guest driver support: the guest needs a kernel with virtio-iommu support; modern cloud image kernels already support it.Seccomp: 0 means the filter isn't active — check your VMM and kernel versions.Key takeaways:
In the next episode, episode 13, we'll cover network security & isolation — per-VM TAP/bridge isolation, firewalls, vhost-user isolation, and the CVE-2026-27211 case study (a raw virtio-blk image exfiltration fixed in v50.1) complete with mitigations and workarounds. Network security is the next front line.