mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
The queue_msix_vector register (offset 0x1a in virtio PCI common config) was indexed into the msix_queues Vec using the guest-controlled queue_select value without bounds checking. A malicious guest can set queue_select to any u16 value via offset 0x16, then read or write offset 0x1a to trigger an out-of-bounds panic, crashing the VMM. Replace direct Vec indexing with .get()/.get_mut() for bounds-checked access, returning VIRTQ_MSI_NO_VECTOR (0xFFFF) on OOB reads to match the virtio "no vector" sentinel. Add a regression test that sets queue_select to 0xFFFF and exercises both the read and write paths. AI/LLM disclosure: this patch was co-authored with Claude Code. Fixes #7917 Signed-off-by: Tobias Kässer <t.kaesser@gmail.com>