CVE-2022-49219
Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
26/02/2025
Last modified:
03/11/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
vfio/pci: fix memory leak during D3hot to D0 transition<br />
<br />
If &#39;vfio_pci_core_device::needs_pm_restore&#39; is set (PCI device does<br />
not have No_Soft_Reset bit set in its PMCSR config register), then<br />
the current PCI state will be saved locally in<br />
&#39;vfio_pci_core_device::pm_save&#39; during D0->D3hot transition and same<br />
will be restored back during D3hot->D0 transition.<br />
For saving the PCI state locally, pci_store_saved_state() is being<br />
used and the pci_load_and_free_saved_state() will free the allocated<br />
memory.<br />
<br />
But for reset related IOCTLs, vfio driver calls PCI reset-related<br />
API&#39;s which will internally change the PCI power state back to D0. So,<br />
when the guest resumes, then it will get the current state as D0 and it<br />
will skip the call to vfio_pci_set_power_state() for changing the<br />
power state to D0 explicitly. In this case, the memory pointed by<br />
&#39;pm_save&#39; will never be freed. In a malicious sequence, the state changing<br />
to D3hot followed by VFIO_DEVICE_RESET/VFIO_DEVICE_PCI_HOT_RESET can be<br />
run in a loop and it can cause an OOM situation.<br />
<br />
This patch frees the earlier allocated memory first before overwriting<br />
&#39;pm_save&#39; to prevent the mentioned memory leak.
Impact
Base Score 3.x
5.50
Severity 3.x
MEDIUM
Vulnerable products and versions
| CPE | From | Up to |
|---|---|---|
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.1 (including) | 5.15.33 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.16 (including) | 5.16.19 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.17 (including) | 5.17.2 (excluding) |
To consult the complete list of CPE names with products and versions, see this page
References to Advisories, Solutions, and Tools
- https://git.kernel.org/stable/c/26ddd196e9eb264da8e1bdc4df8a94d62581c8b5
- https://git.kernel.org/stable/c/4319f17fb8264ba39352b611dfa913a4d8c1d1a0
- https://git.kernel.org/stable/c/c8a1f8bd586ee31020614b8d48b702ece3e2ae44
- https://git.kernel.org/stable/c/da426ad86027b849b877d4628b277ffbbd2f5325
- https://git.kernel.org/stable/c/eadf88ecf6ac7d6a9f47a76c6055d9a1987a8991
- https://lists.debian.org/debian-lts-announce/2025/05/msg00030.html



