HIGH Introduced in 4.12
kvm vgic-v3 LPI UAF
CVE-2026-89913
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
KernelScan AI7.7HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: KVM: arm64: vgic-v3: take an LPI reference in vgic_v3_save_pending_tables vgic_v3_save_pending_tables() iterates dist->lpi_xa using xa_for_each() and dereferences the returned struct vgic_irq in the loop body without holding a reference on the LPI. The xarray iterator only provides temporary RCU coverage while looking up the current entry. That is not sufficient for this loop body, which reads fields from struct vgic_irq and performs guest memory accesses before the iteration completes. A concurrent path can trigger this race: the irqfd cached injection path (vgic_its_inject_cached_translation) obtains a transient LPI reference via vgic_its_check_cache() without holding kvm->lock, vcpu->mutex, config_lock, or its_lock. If guest ITS DISCARD then drops the cache and ITE references under its_lock, the transient inject reference may become the final one. When vgic_put_irq() drops it, the LPI is erased from lpi_xa and freed via kfree_rcu(). Meanwhile, vgic_v3_save_pending_tables() may still hold a stale pointer obtained from the xarray iterator and dereference it after the RCU grace period completes. Fix this by re-fetching each iterated LPI via vgic_get_irq(), which takes a stable reference, and dropping it with vgic_put_irq() on all paths. This matches the pattern already used by other lpi_xa iterators in the vgic ITS code.
02KernelScan AI Analysis
Risk summary
A race condition in KVM's arm64 vgic-v3 interrupt controller allows a malicious guest VM to trigger a use-after-free in the host kernel, potentially leading to host kernel code execution or a host crash. The vulnerability is exploitable by unprivileged guest VMs using the ITS interrupt controller's cached injection and DISCARD commands concurrently with pending table save operations. This is a VM escape vulnerability affecting KVM hypervisors on arm64 systems.
Vulnerability analysis
A race condition exists in KVM's arm64 vgic-v3 interrupt controller where saving pending interrupt tables iterates over LPI entries without holding stable references, allowing a concurrent guest-triggered interrupt injection and ITS DISCARD sequence to free an LPI while it is still being accessed. This results in a use-after-free in the host kernel. The fix re-fetches each LPI through a reference-counting helper before accessing it and releases the reference on all code paths, preventing the object from being freed during iteration. The vulnerable code path is reachable from inside a guest VM using the GICv3 ITS interrupt controller, requiring no special guest privileges—only the ability to issue ITS commands and trigger interrupt injection.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.18 | 4.12 | 6.18.51 | 7631f9529756 |
| 7.2 | 4.12 | 7.2.5 | d3a2d20b7248 |
| mainline | 4.12 | 7.3-rc1 | f5b8f203bfc0 |