iommu/amd: Fix undefined behavior in devid_write debugfs function
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.527.2.67.3In the Linux kernel, the following vulnerability has been resolved:
iommu/amd: Fix undefined behavior in devid_write debugfs function
When for_each_pci_segment() loop completes without finding a matching segment, the pci_seg pointer is not NULL but points to an invalid memory location (the list head). Accessing pci_seg->id after the loop causes undefined behavior.
Fix this by handling the successful case inside the loop and returning -EINVAL after the loop if no matching segment is found.
From the CVE record · Linux
The AMD IOMMU debugfs devid_write function can access an invalid pointer when no matching PCI segment is found, causing undefined behavior. The input does not specify an attacker capability, access requirements, or user interaction needed to trigger it.
Engineers running the Linux kernel should check their vendor’s advisory; affected versions are not specified.