CVE-2026-97953: net: stmmac: fix TX descriptor availability check for TSO traffic
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
net: stmmac: fix TX descriptor availability check for TSO traffic
stmmac_tso_xmit() estimates the number of free TX descriptors required by a TSO skb as:
(skb->len - proto_hdr_len) / TSO_MAX_BUFF_SIZE + 1
which assumes the payload is split into TSO_MAX_BUFF_SIZE chunks. This underestimates the descriptors actually consumed by stmmac_tso_allocator(), since each fragment is mapped individually and so it needs at least one descriptor regardless of its size. Moreover, one descriptor is used for the L2/L3/L4 headers and, when the MSS changes, one more is consumed for the MSS context descriptor.
For a highly fragmented TSO skb the check can therefore pass even when the ring has too few free slots. stmmac_tso_allocator() then writes past the available descriptors, overwriting descriptors still owned by the DMA engine, corrupting the TX ring.
Add stmmac_tso_get_num_desc() to compute the exact number of descriptors needed for the header, the linear payload and each fragment, plus the MSS context descriptor when required, and use it in the availability check.
The Linux kernel CVE team has assigned CVE-2026-97953 to this issue.
Affected and fixed versions
===========================
Issue introduced in 4.7 with commit f748be531d7012c456b97f66091d86b3675c5fef and fixed in 6.12.111 with commit ffa6d2481bc1c87f822ecd626561484e4ee24cef Issue introduced in 4.7 with commit f748be531d7012c456b97f66091d86b3675c5fef and fixed in 6.18.53 with commit c28175220f808c867d5618de8ecc6dbcc815c773 Issue introduced in 4.7 with commit f748be531d7012c456b97f66091d86b3675c5fef and fixed in 7.2.7 with commit 65820fc743eae322f7f94f6a64d07861211d4b21 Issue introduced in 4.7 with commit f748be531d7012c456b97f66091d86b3675c5fef and fixed in 7.3-rc3 with commit 5e38d732ec67a5b1f9a56e6c73add480c4b6030a
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-97953
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/stmicro/stmmac/stmmac_main.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/ffa6d2481bc1c87f822ecd626561484e4ee24cef https://git.kernel.org/stable/c/c28175220f808c867d5618de8ecc6dbcc815c773 https://git.kernel.org/stable/c/65820fc743eae322f7f94f6a64d07861211d4b21 https://git.kernel.org/stable/c/5e38d732ec67a5b1f9a56e6c73add480c4b6030a