mshv: Fix use-after-free in mshv_map_user_memory error path
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 |
|
|
In the Linux kernel, the following vulnerability has been resolved:
mshv: Fix use-after-free in mshv_map_user_memory error path
In the error path of mshv_map_user_memory(), calling vfree() directly on the region leaves the MMU notifier registered. When userspace later unmaps the memory, the notifier fires and accesses the freed region, causing a use-after-free and potential kernel panic.
Replace vfree() with mshv_partition_put() to properly unregister the MMU notifier before freeing the region.
From the CVE record · Linux
The Linux kernel's mshv_map_user_memory() error path can free a region while leaving its MMU notifier registered. If userspace later unmaps the memory, the notifier can access the freed region, causing a use-after-free and potential kernel panic. The input does not specify authentication requirements.
Engineers running Linux kernels with mshv should check their kernel versions for this issue; affected versions are not specified.