You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
openvmm: an out-of-range restored IOAPIC id panics the next ID-register read #1172
IOAPIC restore accepts saved ids above 15, even though the emulated ID register has only a four-bit id field. A crafted or foreign saved state can restore successfully and crash the VM worker on the guest's next ordinary ID-register read.
In vm/devices/chipset/src/ioapic/mod.rs, IoApicDevice::restore extracts the saved u8 id but proceeds to validate the redirection table without checking the id's field width:
The method later assigns self.id = id. When read_register constructs the ID register with with_id(self.id), an id greater than 0xf triggers the bitfield setter's bounds panic. That check is active in release builds as well as debug builds.
Reproduction
Save a 24-line IoApicDevice, change the saved id to 16, and restore it. Select the ID register through the IOAPIC index register at 0xfec00000, then read four bytes from the data register at 0xfec00010.
Restore accepts the state; the read panics because 16 is outside the ID field's [0, 15] range.
Fix
fix.patch checks id <= 0xf at the start of restore and returns RestoreError::InvalidSavedState otherwise, before modifying interrupt routing or device state. Representable ids retain their existing behavior, and rejecting an invalid state leaves the previous device state intact.
Activity
tangruize commentedon Nov 1, 2026
Proposed patch
Patch against OpenVMM
998b9f2402050cd16d1faa897bc831ef1434be48. Save the contents below asfix.patchand rungit apply fix.patch.fix.patchopenvmm: pin the IOAPIC's checked restored id