CVE-2026-92505: iommu/amd: Fix undefined behavior in devid_write debugfs function
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In 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.
The Linux kernel CVE team has assigned CVE-2026-92505 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.17 with commit 2e98940f123d9c69d4759078aea9a536244c98d3 and fixed in 6.18.52 with commit 8aabe0fba01486b5d893e708b05a8fa7f1b7efbb Issue introduced in 6.17 with commit 2e98940f123d9c69d4759078aea9a536244c98d3 and fixed in 7.2.6 with commit 99d42aef089a07cfb1d404a7227ac9dc7628b497 Issue introduced in 6.17 with commit 2e98940f123d9c69d4759078aea9a536244c98d3 and fixed in 7.3-rc1 with commit 843e149989665f8309ad2efe6048dc76591e1f94
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-92505
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/iommu/amd/debugfs.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/8aabe0fba01486b5d893e708b05a8fa7f1b7efbb https://git.kernel.org/stable/c/99d42aef089a07cfb1d404a7227ac9dc7628b497 https://git.kernel.org/stable/c/843e149989665f8309ad2efe6048dc76591e1f94