From 6daa9e14e66c9592253daefb1d2808bf227478ec Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 4 May 2026 22:10:37 +0200 Subject: [PATCH] virtio-devices: Test config vector OOB does not panic Verify that firing a config change interrupt with msix_config vector beyond the table size returns Ok without panicking. Signed-off-by: Anatol Belski --- virtio-devices/src/transport/pci_device.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/virtio-devices/src/transport/pci_device.rs b/virtio-devices/src/transport/pci_device.rs index 594363439..82cd748f4 100644 --- a/virtio-devices/src/transport/pci_device.rs +++ b/virtio-devices/src/transport/pci_device.rs @@ -1406,4 +1406,11 @@ mod unit_tests { intr.msix_config.lock().unwrap().set_msg_ctl(1u16 << 15); intr.trigger(VirtioInterruptType::Queue(0)).unwrap(); } + + #[test] + fn config_vector_oob_does_not_panic() { + let intr = make_msix_interrupt(2); + intr.config_vector.store(0xFFFE, Ordering::Release); + intr.trigger(VirtioInterruptType::Config).unwrap(); + } }