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 <anbelski@linux.microsoft.com>
This commit is contained in:
Anatol Belski
2026-05-04 22:10:37 +02:00
committed by Rob Bradford
parent 6be080c083
commit 6daa9e14e6

View File

@@ -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();
}
}