HIGH Introduced in 6.15
mshv VpArray Race
CVE-2026-80895
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H
01Description
In the Linux kernel, the following vulnerability has been resolved: mshv: Order pt_vp_array publish against irqfd assertion path mshv_partition_ioctl_create_vp() initialises a VP struct (allocations, mutex_init, init_waitqueue_head, page mappings) and then publishes the pointer into partition->pt_vp_array. Several ISR paths read this array locklessly: the intercept ISR, the two scheduler ISRs, and mshv_try_assert_irq_fast() on the irqfd fast path. Of these, only mshv_try_assert_irq_fast() can structurally race the publish. It runs from an eventfd waker without holding pt_mutex, and MSHV_IRQFD does not require the target lapic_apic_id (== vp_index) to refer to an existing VP at registration time. A user can therefore register an irqfd targeting a yet-to-be-created VP, then trigger mshv_try_assert_irq_fast() concurrently with MSHV_CREATE_VP for the same index. On weakly-ordered architectures the reader can observe a non-NULL pointer in pt_vp_array before the initialising stores to the VP struct become visible, leading to use of partially-initialised fields (e.g. vp_register_page). The other ISR readers cannot reach this race: the hypervisor will not generate intercept or scheduler messages for a VP that has never been told to run, and the user can only call MSHV_RUN_VP on the VP fd returned by MSHV_CREATE_VP, which by construction is returned after the publish. Leave those readers as plain loads. Use smp_store_release() in mshv_partition_ioctl_create_vp() to publish the pointer, and pair it with smp_load_acquire() in mshv_try_assert_irq_fast(). On x86 these compile to plain accesses under TSO; on ARM64 they emit one-instruction acquire/release barriers, acceptable on this fast path. The destroy-side path (destroy_partition() clearing pt_vp_array[i] to NULL after kfree(vp)) has a separate ordering and lifetime concern that is out of scope here.
02KernelScan AI Analysis
Risk summary
A local user with access to the /dev/mshv device can register an irqfd targeting a virtual processor index that does not yet exist, then concurrently create that VP. On weakly-ordered architectures the irqfd fast path can observe a partially-initialised VP struct, leading to memory corruption. This is reachable from a container or unprivileged context where the mshv device node is accessible, and can result in kernel code execution or a crash.
Vulnerability analysis
When a virtual processor is created through the mshv interface, the kernel initialises a VP structure and publishes a pointer to it in a per-partition array. A separate irqfd fast path reads this array locklessly from an eventfd waker without holding the partition mutex, and irqfd registration does not require the target VP to already exist. A user can therefore register an irqfd for a not-yet-created VP and trigger the fast path concurrently with VP creation; on weakly-ordered architectures the reader can see the pointer before the VP's initialising stores become visible, causing use of partially-initialised fields and memory corruption. The fix publishes the pointer with a release store and pairs it with an acquire load on the fast path, ensuring any non-NULL pointer implies a fully-initialised VP. The vulnerable path is reachable by any local user who can open /dev/mshv, which on container hosts may be exposed to unprivileged tenants.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.18 | 6.15 | 6.18.44 | 062aa5dcc49a |
| 7.1 | 6.15 | 7.1.8 | eba2bf5daa79 |
| mainline | 6.15 | 7.2 | b098dc869219 |