CVE-2026-31737: net: ftgmac100: fix ring allocation unwind on open failure
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
net: ftgmac100: fix ring allocation unwind on open failure
ftgmac100_alloc_rings() allocates rx_skbs, tx_skbs, rxdes, txdes, and rx_scratch in stages. On intermediate failures it returned -ENOMEM directly, leaking resources allocated earlier in the function.
Rework the failure path to use staged local unwind labels and free allocated resources in reverse order before returning -ENOMEM. This matches common netdev allocation cleanup style.
The Linux kernel CVE team has assigned CVE-2026-31737 to this issue.
Affected and fixed versions
===========================
Issue introduced in 4.12 with commit d72e01a0430f8a1ae7adb3cbf0b2e73fcd99252e and fixed in 5.10.253 with commit 184b3a500d60ea48d1b176103cff1706c456edf3 Issue introduced in 4.12 with commit d72e01a0430f8a1ae7adb3cbf0b2e73fcd99252e and fixed in 5.15.203 with commit 78da43320d9d6ed788147fb085184e4fc801f057 Issue introduced in 4.12 with commit d72e01a0430f8a1ae7adb3cbf0b2e73fcd99252e and fixed in 6.1.168 with commit a7e1bf392acf11dc4209820fef75758f6e42bd65 Issue introduced in 4.12 with commit d72e01a0430f8a1ae7adb3cbf0b2e73fcd99252e and fixed in 6.6.134 with commit 8a71911fc7eeea930153322bc1efc065db8cd97e Issue introduced in 4.12 with commit d72e01a0430f8a1ae7adb3cbf0b2e73fcd99252e and fixed in 6.12.81 with commit d45230081f19c280096241353c26b0de457de795 Issue introduced in 4.12 with commit d72e01a0430f8a1ae7adb3cbf0b2e73fcd99252e and fixed in 6.18.22 with commit 8351d18989c8642fc53e2e12d94e42314a39b078 Issue introduced in 4.12 with commit d72e01a0430f8a1ae7adb3cbf0b2e73fcd99252e and fixed in 6.19.12 with commit 82f86111f0704ab2ded11a2033bc6cf0be3e09ea Issue introduced in 4.12 with commit d72e01a0430f8a1ae7adb3cbf0b2e73fcd99252e and fixed in 7.0 with commit c0fd0fe745f5e8c568d898cd1513d0083e46204a
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-31737
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/net/ethernet/faraday/ftgmac100.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/184b3a500d60ea48d1b176103cff1706c456edf3 https://git.kernel.org/stable/c/78da43320d9d6ed788147fb085184e4fc801f057 https://git.kernel.org/stable/c/a7e1bf392acf11dc4209820fef75758f6e42bd65 https://git.kernel.org/stable/c/8a71911fc7eeea930153322bc1efc065db8cd97e https://git.kernel.org/stable/c/d45230081f19c280096241353c26b0de457de795 https://git.kernel.org/stable/c/8351d18989c8642fc53e2e12d94e42314a39b078 https://git.kernel.org/stable/c/82f86111f0704ab2ded11a2033bc6cf0be3e09ea https://git.kernel.org/stable/c/c0fd0fe745f5e8c568d898cd1513d0083e46204a