freenode
Databases & Infrastructure

QEMU closes use-after-free in Xen guest vCPU timers

A guest could arm a periodic PV timer, hot-unplug the vCPU, and leave the callback aimed at freed CPU state, tracked as CVE-2026-123069.

QEMU's Xen emulation on x86 failed to free per-vCPU timers when a virtual CPU was destroyed, leaving a use-after-free that a guest could trigger by hot-unplugging a CPU it had already armed. The flaw is CVE-2026-123069.

David Woodhouse of Amazon wrote that the setup path allocated those timers with the CPU object as the callback context, and nothing released them on destruction. A guest could set the periodic paravirtual timer, which always reaches QEMU because the kernel does not handle that operation, then eject the vCPU through ACPI hotplug. The armed timer still pointed at the freed CPU state.

The fix frees both the periodic and singleshot timers when the vCPU is torn down, under the same lock that serializes timer hypercalls from other vCPUs. Periodic timer operations now fail as they would for a nonexistent vCPU once those pointers are cleared. Singleshot operations only act on the calling vCPU, so they cannot race that vCPU's destruction. The periodic timer's deletion is also taken under the same lock.

MyeonghunPak reported the issue. Paul Durrant reviewed the change. The missing cleanup dated to the original handling of Xen PV timer hypercalls in QEMU's KVM Xen emulation.