KVM: arm64: vgic: Handle race between interrupt affinity change and LPI disabling
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 5dd4b924e390af426e424d5e52c1b4d1566af817 · < 7258770e5814f15e8308ebda82ac9acf6964ba8e| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
KVM: arm64: vgic: Handle race between interrupt affinity change and LPI disabling
Hyunwoo Kim reports some really bad races should the following situation occur:
- LPI-I is pending in vcpu-B's AP list - vcpu-A writes to vcpu-B's RD to disable its LPIs - vcpu-C moves I from B to C
If the last two race nicely enough, vgic_prune_ap_list() can drop the irq and AP list locks, reacquire them, and in the interval the irq has been freed. UAF follows.
The fix is two-fold:
- Before dropping the irq and ap_list locks, take a reference on the irq
- Do not try to handle migration of the pending bit: there is no expectation that this state is retained, as per the architecture
From the CVE record · Linux
A race in the Linux kernel’s KVM arm64 virtual interrupt controller can cause a use-after-free. It can occur when guest vCPUs concurrently disable LPIs and change a pending interrupt’s affinity. The input does not establish whether an attacker can trigger it remotely or what access is required.
Teams running Linux kernels with KVM on arm64 should check their deployments; affected versions are not specified.