KVM: arm64: Eagerly init vgic dist/redist on vgic creation
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
6.18.196.19.97.0In the Linux kernel, the following vulnerability has been resolved:
KVM: arm64: Eagerly init vgic dist/redist on vgic creation
If vgic_allocate_private_irqs_locked() fails for any odd reason, we exit kvm_vgic_create() early, leaving dist->rd_regions uninitialised.
kvm_vgic_dist_destroy() then comes along and walks into the weeds trying to free the RDs. Got to love this stuff.
Solve it by moving all the static initialisation early, and make sure that if we fail halfway, we're in a reasonable shape to perform the rest of the teardown. While at it, reset the vgic model on failure, just in case...
From the CVE record · Linux
In the Linux kernel’s KVM arm64 VGIC, a failure while allocating private interrupts can leave distributor regions uninitialized. Subsequent teardown may attempt to free those regions. The input does not specify how an attacker could trigger the failure or whether authentication or user interaction is required.
Engineers running Linux kernels with KVM arm64 VGIC should check their exposure; affected versions are not specified.