{"id":"CVE-2026-31649","state":"PUBLISHED","title":"net: stmmac: fix integer underflow in chain mode","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nnet: stmmac: fix integer underflow in chain mode\n\nThe jumbo_frm() chain-mode implementation unconditionally computes\n\n    len = nopaged_len - bmax;\n\nwhere nopaged_len = skb_headlen(skb) (linear bytes only) and bmax is\nBUF_SIZE_8KiB or BUF_SIZE_2KiB.  However, the caller stmmac_xmit()\ndecides to invoke jumbo_frm() based on skb->len (total length including\npage fragments):\n\n    is_jumbo = stmmac_is_jumbo_frm(priv, skb->len, enh_desc);\n\nWhen a packet has a small linear portion (nopaged_len <= bmax) but a\nlarge total length due to page fragments (skb->len > bmax), the\nsubtraction wraps as an unsigned integer, producing a huge len value\n(~0xFFFFxxxx).  This causes the while (len != 0) loop to execute\nhundreds of thousands of iterations, passing skb->data + bmax * i\npointers far beyond the skb buffer to dma_map_single().  On IOMMU-less\nSoCs (the typical deployment for stmmac), this maps arbitrary kernel\nmemory to the DMA engine, constituting a kernel memory disclosure and\npotential memory corruption from hardware.\n\nFix this by introducing a buf_len local variable clamped to\nmin(nopaged_len, bmax).  Computing len = nopaged_len - buf_len is then\nalways safe: it is zero when the linear portion fits within a single\ndescriptor, causing the while (len != 0) loop to be skipped naturally,\nand the fragment loop in stmmac_xmit() handles page fragments afterward.","publishedAt":"2026-04-24T14:45:02.520Z","updatedAt":"2026-10-19T18:56:01.547Z","severity":{"score":9.8,"label":"Critical","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"286a837217204b1ef105e3a554d0757e4fdfaac1","status":"affected","lessThan":"513e06735f5be575b409d195822195348b164e48","versionType":"git"},{"version":"286a837217204b1ef105e3a554d0757e4fdfaac1","status":"affected","lessThan":"275bdf762e82082f064e60a92448fa2ac43cf95b","versionType":"git"},{"version":"286a837217204b1ef105e3a554d0757e4fdfaac1","status":"affected","lessThan":"a2b68a9a476b9544ff31f1fbcd5d80867a8a5e2f","versionType":"git"},{"version":"286a837217204b1ef105e3a554d0757e4fdfaac1","status":"affected","lessThan":"b7b8012193fd98236d7ae05d4b553f010a77b2ef","versionType":"git"},{"version":"286a837217204b1ef105e3a554d0757e4fdfaac1","status":"affected","lessThan":"2c91b39912278d0878f9ba60ba04d2518b18a08d","versionType":"git"},{"version":"286a837217204b1ef105e3a554d0757e4fdfaac1","status":"affected","lessThan":"6fca757c20396dc2e604dcc61922264e9e3dc803","versionType":"git"},{"version":"286a837217204b1ef105e3a554d0757e4fdfaac1","status":"affected","lessThan":"10d12b9240ebf96c785f0e2e4228318cd5f3a3eb","versionType":"git"},{"version":"286a837217204b1ef105e3a554d0757e4fdfaac1","status":"affected","lessThan":"51f4e090b9f87b40c21b6daadb5c06e6c0a07b67","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/net/ethernet/stmicro/stmmac/chain_mode.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.2","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.2","versionType":"semver"},{"version":"5.10.253","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.203","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.169","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.135","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.82","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.23","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"6.19.13","status":"unaffected","lessThanOrEqual":"6.19.*","versionType":"semver"},{"version":"7.0","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/net/ethernet/stmicro/stmmac/chain_mode.c"]}],"references":["https://git.kernel.org/stable/c/513e06735f5be575b409d195822195348b164e48","https://git.kernel.org/stable/c/275bdf762e82082f064e60a92448fa2ac43cf95b","https://git.kernel.org/stable/c/a2b68a9a476b9544ff31f1fbcd5d80867a8a5e2f","https://git.kernel.org/stable/c/b7b8012193fd98236d7ae05d4b553f010a77b2ef","https://git.kernel.org/stable/c/2c91b39912278d0878f9ba60ba04d2518b18a08d","https://git.kernel.org/stable/c/6fca757c20396dc2e604dcc61922264e9e3dc803","https://git.kernel.org/stable/c/10d12b9240ebf96c785f0e2e4228318cd5f3a3eb","https://git.kernel.org/stable/c/51f4e090b9f87b40c21b6daadb5c06e6c0a07b67","https://cert-portal.siemens.com/productcert/html/ssa-082556.html","https://cert-portal.siemens.com/productcert/html/ssa-019113.html","https://cert-portal.siemens.com/productcert/html/ssa-457936.html"],"weaknesses":["CWE-190"],"ingestedAt":"2026-10-29T20:11:40.391Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/31xxx/CVE-2026-31649.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-31649","state":"PUBLISHED","datePublished":"2026-04-24T14:45:02.520Z","dateUpdated":"2026-10-19T18:56:01.547Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-03-09T15:48:24.128Z"},"containers":{"cna":{"title":"net: stmmac: fix integer underflow in chain mode","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nnet: stmmac: fix integer underflow in chain mode\n\nThe jumbo_frm() chain-mode implementation unconditionally computes\n\n    len = nopaged_len - bmax;\n\nwhere nopaged_len = skb_headlen(skb) (linear bytes only) and bmax is\nBUF_SIZE_8KiB or BUF_SIZE_2KiB.  However, the caller stmmac_xmit()\ndecides to invoke jumbo_frm() based on skb->len (total length including\npage fragments):\n\n    is_jumbo = stmmac_is_jumbo_frm(priv, skb->len, enh_desc);\n\nWhen a packet has a small linear portion (nopaged_len <= bmax) but a\nlarge total length due to page fragments (skb->len > bmax), the\nsubtraction wraps as an unsigned integer, producing a huge len value\n(~0xFFFFxxxx).  This causes the while (len != 0) loop to execute\nhundreds of thousands of iterations, passing skb->data + bmax * i\npointers far beyond the skb buffer to dma_map_single().  On IOMMU-less\nSoCs (the typical deployment for stmmac), this maps arbitrary kernel\nmemory to the DMA engine, constituting a kernel memory disclosure and\npotential memory corruption from hardware.\n\nFix this by introducing a buf_len local variable clamped to\nmin(nopaged_len, bmax).  Computing len = nopaged_len - buf_len is then\nalways safe: it is zero when the linear portion fits within a single\ndescriptor, causing the while (len != 0) loop to be skipped naturally,\nand the fragment loop in stmmac_xmit() handles page fragments afterward."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"286a837217204b1ef105e3a554d0757e4fdfaac1","status":"affected","lessThan":"513e06735f5be575b409d195822195348b164e48","versionType":"git"},{"version":"286a837217204b1ef105e3a554d0757e4fdfaac1","status":"affected","lessThan":"275bdf762e82082f064e60a92448fa2ac43cf95b","versionType":"git"},{"version":"286a837217204b1ef105e3a554d0757e4fdfaac1","status":"affected","lessThan":"a2b68a9a476b9544ff31f1fbcd5d80867a8a5e2f","versionType":"git"},{"version":"286a837217204b1ef105e3a554d0757e4fdfaac1","status":"affected","lessThan":"b7b8012193fd98236d7ae05d4b553f010a77b2ef","versionType":"git"},{"version":"286a837217204b1ef105e3a554d0757e4fdfaac1","status":"affected","lessThan":"2c91b39912278d0878f9ba60ba04d2518b18a08d","versionType":"git"},{"version":"286a837217204b1ef105e3a554d0757e4fdfaac1","status":"affected","lessThan":"6fca757c20396dc2e604dcc61922264e9e3dc803","versionType":"git"},{"version":"286a837217204b1ef105e3a554d0757e4fdfaac1","status":"affected","lessThan":"10d12b9240ebf96c785f0e2e4228318cd5f3a3eb","versionType":"git"},{"version":"286a837217204b1ef105e3a554d0757e4fdfaac1","status":"affected","lessThan":"51f4e090b9f87b40c21b6daadb5c06e6c0a07b67","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/net/ethernet/stmicro/stmmac/chain_mode.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.2","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.2","versionType":"semver"},{"version":"5.10.253","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.203","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.169","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.135","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.82","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.23","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"6.19.13","status":"unaffected","lessThanOrEqual":"6.19.*","versionType":"semver"},{"version":"7.0","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/net/ethernet/stmicro/stmmac/chain_mode.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/513e06735f5be575b409d195822195348b164e48"},{"url":"https://git.kernel.org/stable/c/275bdf762e82082f064e60a92448fa2ac43cf95b"},{"url":"https://git.kernel.org/stable/c/a2b68a9a476b9544ff31f1fbcd5d80867a8a5e2f"},{"url":"https://git.kernel.org/stable/c/b7b8012193fd98236d7ae05d4b553f010a77b2ef"},{"url":"https://git.kernel.org/stable/c/2c91b39912278d0878f9ba60ba04d2518b18a08d"},{"url":"https://git.kernel.org/stable/c/6fca757c20396dc2e604dcc61922264e9e3dc803"},{"url":"https://git.kernel.org/stable/c/10d12b9240ebf96c785f0e2e4228318cd5f3a3eb"},{"url":"https://git.kernel.org/stable/c/51f4e090b9f87b40c21b6daadb5c06e6c0a07b67"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","baseScore":9.8,"baseSeverity":"CRITICAL"},"scenarios":[{"lang":"en","value":"AV:N - The vulnerable stmmac transmit path can be reached over the network when an unauthenticated peer causes a network-facing service or forwarding/router workload to transmit large non-linear skbs through an affected stmmac interface. This is a plausible deployment for embedded/router/NFS/TLS systems using this Ethernet MAC.\nAC:L - Once the system is using affected chain mode, the trigger is a non-linear packet whose total length exceeds the jumbo threshold while the linear head does not, which common scatter-gather/sendpage paths can produce. There is no race or attacker-uncontrolled timing requirement.\nPR:N - In the highest reasonable scenario, a remote unauthenticated client can trigger large page-backed responses or forwarded traffic through the vulnerable device. No local account or administrative capability is required for that network-triggered path.\nUI:N - No victim user action is needed beyond the system already running the affected driver and network service or forwarding configuration. The attacker can trigger transmission by network interaction.\nS:U - The vulnerability is in the host kernel network driver and impacts the same host kernel security authority. It does not cross a VM, IOMMU, or other separate security scope boundary by itself.\nC:H - The underflow makes the driver DMA-map addresses far beyond the skb buffer, exposing arbitrary kernel memory to the DMA engine and potentially onto the wire. That supports high confidentiality impact.\nI:H - The erroneous descriptor programming gives hardware DMA access to unintended kernel memory ranges and the fix description identifies potential memory corruption from hardware. Under the required tie-breaker, this is scored as high integrity impact.\nA:H - The huge wrapped loop and invalid DMA mappings can exhaust/overwrite TX descriptors, hit DMA/IOMMU faults, hang transmission, or crash the kernel. This is high availability impact."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T12:24:08.585Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.2","versionEndExcluding":"5.10.253"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.2","versionEndExcluding":"5.15.203"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.2","versionEndExcluding":"6.1.169"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.2","versionEndExcluding":"6.6.135"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.2","versionEndExcluding":"6.12.82"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.2","versionEndExcluding":"6.18.23"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.2","versionEndExcluding":"6.19.13"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.2","versionEndExcluding":"7.0"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"affected":[{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.6","status":"affected","lessThan":"*","versionType":"custom"}]},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.5","status":"affected","lessThan":"*","versionType":"custom"}]},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.7","status":"affected","lessThan":"*","versionType":"custom"}]},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.6","status":"affected","lessThan":"*","versionType":"custom"}]},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.5","status":"affected","lessThan":"*","versionType":"custom"}]},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.7","status":"affected","lessThan":"*","versionType":"custom"}]},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.6","status":"affected","lessThan":"*","versionType":"custom"}]},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.5","status":"affected","lessThan":"*","versionType":"custom"}]},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.7","status":"affected","lessThan":"*","versionType":"custom"}]},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.6","status":"affected","lessThan":"*","versionType":"custom"}]},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.5","status":"affected","lessThan":"*","versionType":"custom"}]},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.7","status":"affected","lessThan":"*","versionType":"custom"}]},{"vendor":"Siemens","product":"SIPLUS S7-1500 CPU 1518-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.6","status":"affected","lessThan":"*","versionType":"custom"}]},{"vendor":"Siemens","product":"SIPLUS S7-1500 CPU 1518-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.5","status":"affected","lessThan":"*","versionType":"custom"}]},{"vendor":"Siemens","product":"SIPLUS S7-1500 CPU 1518-4 PN/DP MFP","defaultStatus":"unknown","versions":[{"version":"V3.1.7","status":"affected","lessThan":"*","versionType":"custom"}]}],"references":[{"url":"https://cert-portal.siemens.com/productcert/html/ssa-082556.html"},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-019113.html"},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-457936.html"}],"providerMetadata":{"shortName":"siemens-SADP","orgId":"0b142b55-0307-4c5a-b3c9-f314f3fb7c5e","dateUpdated":"2026-10-15T01:17:28.732Z"},"x_adpType":"supplier"},{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"id":"CVE-2026-31649","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"yes"},{"Technical Impact":"total"}],"version":"2.0.3","timestamp":"2026-10-16T15:11:32.382744Z"}}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-190","lang":"en","type":"CWE","description":"CWE-190 Integer Overflow or Wraparound"}]}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-10-19T18:56:01.547Z"}}]}}}