Linux kernel unallocated memory write in Hyper-V VP index lookup
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
x86/hyperv: Avoid using per-cpu output page in hv_apicid_to_vp_index()
hv_apicid_to_vp_index() currently uses the per-cpu hypercall input and output pages. This function is called when running in VTL2 and when running in an SEV-SNP CoCo VM with no paravisor. In the former case, the output page is allocated, but in the latter case it is not, so the hypervisor stores the output VP index in memory that has not been allocated by the guest.
Fix this by using the input page for both input and output. The hypercall has very small input and output, so sharing the same page for both is straightforward. An alternative fix is to allocate the per-cpu output page when running in an SEV-SNP CoCo guest, but this uses significantly more memory, particularly with larger vCPUs counts.
From the CVE record · Linux
The Linux kernel’s hv_apicid_to_vp_index() function uses a per-CPU output page that is not allocated in an SEV-SNP CoCo VM without a paravisor. When the function runs in that configuration, the hypervisor writes the output VP index to memory the guest has not allocated. The input does not describe an attacker or exploitation prerequisites.
Engineers running the Linux kernel in SEV-SNP CoCo VMs without a paravisor should check their kernel versions; affected versions were not provided.