{"id":"CVE-2026-31649","aliases":["CVE-2026-31649"],"related":[],"kind":"vulnerability","state":"published","title":"net: stmmac: fix integer underflow in chain mode","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad:\n\nnet: stmmac: corrección de subdesbordamiento de enteros en modo cadena\n\nLa implementación en modo cadena de jumbo_frm() calcula incondicionalmente\n\nlen = nopaged_len - bmax;\n\ndonde nopaged_len = skb_headlen(skb) (solo bytes lineales) y bmax es BUF_SIZE_8KiB o BUF_SIZE_2KiB. Sin embargo, la función llamadora stmmac_xmit() decide invocar jumbo_frm() basándose en skb  ->  len (longitud total incluyendo fragmentos de página):\n\nis_jumbo = stmmac_is_jumbo_frm(priv, skb  ->  len, enh_desc);\n\nCuando un paquete tiene una pequeña porción lineal (nopaged_len <= bmax) pero una gran longitud total debido a fragmentos de página (skb  ->  len > bmax), la resta desborda como un entero sin signo, produciendo un valor de len enorme (~0x FFFFxxxx). Esto hace que el bucle while (len != 0) se ejecute cientos de miles de iteraciones, pasando punteros skb  ->  data + bmax * i mucho más allá del búfer skb a dma_map_single(). En SoCs sin IOMMU (la implementación típica para stmmac), esto mapea memoria arbitraria del kernel al motor DMA, constituyendo una divulgación de memoria del kernel y una potencial corrupción de memoria desde el hardware.\n\nEsto se soluciona introduciendo una variable local buf_len limitada a min(nopaged_len, bmax). Calcular len = nopaged_len - buf_len es entonces siempre seguro: es cero cuando la porción lineal cabe dentro de un solo descriptor, haciendo que el bucle while (len != 0) se omita de forma natural, y el bucle de fragmentos en stmmac_xmit() maneja los fragmentos de página después.","source":"nvd"}],"published":"2026-04-24T14:45:02.520Z","modified":"2026-11-11T23:10:00.263Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":["CWE-190"],"affected":[{"ranges":[{"type":"git","introduced":"286a837217204b1ef105e3a554d0757e4fdfaac1","fixed":"513e06735f5be575b409d195822195348b164e48","status":"affected"},{"type":"git","introduced":"286a837217204b1ef105e3a554d0757e4fdfaac1","fixed":"275bdf762e82082f064e60a92448fa2ac43cf95b","status":"affected"},{"type":"git","introduced":"286a837217204b1ef105e3a554d0757e4fdfaac1","fixed":"a2b68a9a476b9544ff31f1fbcd5d80867a8a5e2f","status":"affected"},{"type":"git","introduced":"286a837217204b1ef105e3a554d0757e4fdfaac1","fixed":"b7b8012193fd98236d7ae05d4b553f010a77b2ef","status":"affected"},{"type":"git","introduced":"286a837217204b1ef105e3a554d0757e4fdfaac1","fixed":"2c91b39912278d0878f9ba60ba04d2518b18a08d","status":"affected"},{"type":"git","introduced":"286a837217204b1ef105e3a554d0757e4fdfaac1","fixed":"6fca757c20396dc2e604dcc61922264e9e3dc803","status":"affected"},{"type":"git","introduced":"286a837217204b1ef105e3a554d0757e4fdfaac1","fixed":"10d12b9240ebf96c785f0e2e4228318cd5f3a3eb","status":"affected"},{"type":"git","introduced":"286a837217204b1ef105e3a554d0757e4fdfaac1","fixed":"51f4e090b9f87b40c21b6daadb5c06e6c0a07b67","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"3.2","status":"affected"},{"type":"semver","introduced":"0","fixed":"3.2","status":"unaffected"},{"type":"semver","introduced":"5.10.253","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.203","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.169","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.135","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.82","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.23","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"6.19.13","lastAffected":"6.19.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.0","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"3.2.1","fixed":"5.10.253"},{"status":"affected","introduced":"5.11","fixed":"5.15.203"},{"status":"affected","introduced":"5.16","fixed":"6.1.169"},{"status":"affected","introduced":"6.2","fixed":"6.6.135"},{"status":"affected","introduced":"6.7","fixed":"6.12.82"},{"status":"affected","introduced":"6.13","fixed":"6.18.23"},{"status":"affected","introduced":"6.19","fixed":"6.19.13"},{"status":"affected","version":"3.2"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/513e06735f5be575b409d195822195348b164e48","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/275bdf762e82082f064e60a92448fa2ac43cf95b","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/a2b68a9a476b9544ff31f1fbcd5d80867a8a5e2f","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/b7b8012193fd98236d7ae05d4b553f010a77b2ef","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/2c91b39912278d0878f9ba60ba04d2518b18a08d","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/6fca757c20396dc2e604dcc61922264e9e3dc803","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/10d12b9240ebf96c785f0e2e4228318cd5f3a3eb","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/51f4e090b9f87b40c21b6daadb5c06e6c0a07b67","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-082556.html","tags":[],"sources":["cvelist","nvd"]},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-019113.html","tags":[],"sources":["cvelist","nvd"]},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-457936.html","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"total","date":"2026-10-16T15:11:32.382Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-31649","url":"https://www.cve.org/CVERecord?id=CVE-2026-31649","licence":"CVE Terms of Use","modified":"2026-11-10T12:45:08.607Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-31649","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31649","licence":"Public domain","modified":"2026-11-11T23:10:00.263Z"}],"updatedAt":"2026-11-25T22:59:19.533Z","epss":{"score":0.00597,"percentile":0.49892,"date":"2026-12-01T12:00:22.000Z"}}