PCI: endpoint: pci-ep-msi: Fix error unwind and prevent double alloc
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.337.0.107.1In the Linux kernel, the following vulnerability has been resolved:
PCI: endpoint: pci-ep-msi: Fix error unwind and prevent double alloc
pci_epf_alloc_doorbell() stores the allocated doorbell message array in epf->db_msg/epf->num_db before requesting MSI vectors. If MSI allocation fails, the array is freed but the EPF state may still point to freed memory.
Clear epf->db_msg and epf->num_db on the MSI allocation failure path so that later cleanup cannot double-free the array and callers can retry allocation.
Also return -EBUSY when doorbells have already been allocated to prevent leaking or overwriting an existing allocation.
From the CVE record · Linux
The Linux kernel’s PCI endpoint MSI doorbell allocation can leave a pointer to freed memory when MSI vector allocation fails. Later cleanup can double-free the array; a repeat allocation can also leak or overwrite an existing allocation. The input does not specify whether exploitation requires local access, authentication, or user interaction.
Engineers running Linux kernels with the PCI endpoint MSI doorbell code should check their versions; affected versions are not specified.