mshv: Fix error handling in mshv_region_pin
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.576.19.127.0In the Linux kernel, the following vulnerability has been resolved:
mshv: Fix error handling in mshv_region_pin
The current error handling has two issues:
First, pin_user_pages_fast() can return a short pin count (less than requested but greater than zero) when it cannot pin all requested pages. This is treated as success, leading to partially pinned regions being used, which causes memory corruption.
Second, when an error occurs mid-loop, already pinned pages from the current batch are not properly accounted for before calling mshv_region_invalidate_pages(), causing a page reference leak.
Treat short pins as errors and fix partial batch accounting before cleanup.
From the CVE record · Linux
The Linux kernel's mshv_region_pin can treat a partially pinned memory region as valid, causing memory corruption. Errors during pinning can also leak page references. The input does not specify how an attacker could trigger these issues or whether access or user interaction is required.
Engineers running Linux kernels with mshv should check their systems; affected versions are not specified.