{"id":"CVE-2026-143344","state":"PUBLISHED","title":"net: stmmac: drop multi-buffer frames in XDP mode","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nnet: stmmac: drop multi-buffer frames in XDP mode\n\nstmmac_rx() runs the XDP program once per descriptor buffer and uses\nskb == NULL as the only marker for the start of a frame. A frame larger\nthan one buffer is split by the hardware across several descriptors;\nGMAC4 enables jumbo frames unconditionally (GMAC_CONFIG_JE in\nGMAC_CORE_INIT), so an on-link peer can deliver such a frame even when\nthe interface MTU is left at 1500.\n\nWhen an XDP verdict ends a non-last descriptor, skb is cleared and the\nnext descriptor of the same hardware frame is parsed as a new frame.\nFor XDP_CONSUMED this happens via read_again with len preserved, so\nstmmac_rx_buf1_len() then returns min(dma_buf_sz, plen - len) for the\nlast descriptor, which can be as small as 0-3 bytes. buf1_len -=\nETH_FCS_LEN underflows and xdp_prepare_buff() puts data_end far past\ndata; on XDP_PASS this produces an skb whose length is close to 4G that\nreaches the network stack (skb->tail and skb->len are 32-bit and wrap\nbelow skb->end, so skb_over_panic() does not fire). A 4+ byte tail is\ninstead offered to the XDP program and delivered as a standalone\nmid-payload Ethernet frame on XDP_PASS. XDP_TX/XDP_REDIRECT instead\nfalls through to the next iteration, resetting the running length, so\nthe tail is re-parsed as a full-size new frame.\n\nThe same fault exists when a single descriptor uses its second buffer:\nbuffer2 is now handed to the hardware for non-SPH frames on GMAC4/XGMAC,\nso a frame up to 2 * dma_buf_sz can land on a single descriptor while the\nXDP program still only sees the first buffer. XDP_TX then transmits a\ntruncated frame, and XDP_PASS appends the second buffer only after the\nprogram has already run over the first one.\n\nXDP does not support scatter-gather frames until the multi-buffer\nrework, so drop the whole frame instead. When a non-last descriptor is\nseen while an XDP program is attached, mark the frame as errored and\ndrain the remaining descriptors, including the last. A descriptor that\nuses its second buffer is dropped directly before the program runs as\nwell; in XDP mode it is necessarily the last descriptor of the frame,\nso it does not need the error marker. Removing the re-parse lets both\nXDP verdict branches simply complete the packet via next.\n\nThe buffers consumed by the discard path are no longer returned to the\npage pool, and the new SG and second-buffer drops do not return them\neither. They stay in rx_q->buf_pool[] and stmmac_rx_refill() reuses them\nin place, allocating only when a slot is empty. This is safe because the\ndrop checks run before the buffer is synced for CPU access or\nprefetched. The discard-path change and the in-place reuse apply with or\nwithout an XDP program attached.\n\nThe !error guard on the discard check also changes the accounting for\nerrored multi-descriptor frames on dwmac100/dwmac1000: rx_errors is\nincremented once per frame instead of once per descriptor. This too is\nindependent of XDP mode.\n\nNote: the subsequent \"net: stmmac: rework stmmac_rx to support XDP rx\nmulti-buff\" accumulates the whole frame into a single xdp_buff and\nsupersedes this patch; the fix is kept so the net portion of the series\nstands on its own.","publishedAt":"2026-12-03T09:22:03.891Z","updatedAt":"2026-12-03T09:22:03.891Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"5fabb01207a2d3439a6abe1d08640de9c942945f","status":"affected","lessThan":"ffa7563878f8a52390ea50a3994df0d2a588ae0b","versionType":"git"},{"version":"5fabb01207a2d3439a6abe1d08640de9c942945f","status":"affected","lessThan":"10f01285eb9db4a92ecb927273dd332e217265ac","versionType":"git"},{"version":"5fabb01207a2d3439a6abe1d08640de9c942945f","status":"affected","lessThan":"52ffd771e0029c5ad0504b1b4a8b7f932b65eea3","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/net/ethernet/stmicro/stmmac/stmmac_main.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.13","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.13","versionType":"semver"},{"version":"6.18.66","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.7","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc2","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/stmmac_main.c"]}],"references":["https://git.kernel.org/stable/c/ffa7563878f8a52390ea50a3994df0d2a588ae0b","https://git.kernel.org/stable/c/10f01285eb9db4a92ecb927273dd332e217265ac","https://git.kernel.org/stable/c/52ffd771e0029c5ad0504b1b4a8b7f932b65eea3"],"weaknesses":[],"ingestedAt":"2026-12-03T09:44:04.436Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/143xxx/CVE-2026-143344.json","commit":"9e309c7c0f08856e2558a1df33f75dca027fab70","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-143344","state":"PUBLISHED","datePublished":"2026-12-03T09:22:03.891Z","dateUpdated":"2026-12-03T09:22:03.891Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-12-03T03:10:28.368Z"},"containers":{"cna":{"title":"net: stmmac: drop multi-buffer frames in XDP mode","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nnet: stmmac: drop multi-buffer frames in XDP mode\n\nstmmac_rx() runs the XDP program once per descriptor buffer and uses\nskb == NULL as the only marker for the start of a frame. A frame larger\nthan one buffer is split by the hardware across several descriptors;\nGMAC4 enables jumbo frames unconditionally (GMAC_CONFIG_JE in\nGMAC_CORE_INIT), so an on-link peer can deliver such a frame even when\nthe interface MTU is left at 1500.\n\nWhen an XDP verdict ends a non-last descriptor, skb is cleared and the\nnext descriptor of the same hardware frame is parsed as a new frame.\nFor XDP_CONSUMED this happens via read_again with len preserved, so\nstmmac_rx_buf1_len() then returns min(dma_buf_sz, plen - len) for the\nlast descriptor, which can be as small as 0-3 bytes. buf1_len -=\nETH_FCS_LEN underflows and xdp_prepare_buff() puts data_end far past\ndata; on XDP_PASS this produces an skb whose length is close to 4G that\nreaches the network stack (skb->tail and skb->len are 32-bit and wrap\nbelow skb->end, so skb_over_panic() does not fire). A 4+ byte tail is\ninstead offered to the XDP program and delivered as a standalone\nmid-payload Ethernet frame on XDP_PASS. XDP_TX/XDP_REDIRECT instead\nfalls through to the next iteration, resetting the running length, so\nthe tail is re-parsed as a full-size new frame.\n\nThe same fault exists when a single descriptor uses its second buffer:\nbuffer2 is now handed to the hardware for non-SPH frames on GMAC4/XGMAC,\nso a frame up to 2 * dma_buf_sz can land on a single descriptor while the\nXDP program still only sees the first buffer. XDP_TX then transmits a\ntruncated frame, and XDP_PASS appends the second buffer only after the\nprogram has already run over the first one.\n\nXDP does not support scatter-gather frames until the multi-buffer\nrework, so drop the whole frame instead. When a non-last descriptor is\nseen while an XDP program is attached, mark the frame as errored and\ndrain the remaining descriptors, including the last. A descriptor that\nuses its second buffer is dropped directly before the program runs as\nwell; in XDP mode it is necessarily the last descriptor of the frame,\nso it does not need the error marker. Removing the re-parse lets both\nXDP verdict branches simply complete the packet via next.\n\nThe buffers consumed by the discard path are no longer returned to the\npage pool, and the new SG and second-buffer drops do not return them\neither. They stay in rx_q->buf_pool[] and stmmac_rx_refill() reuses them\nin place, allocating only when a slot is empty. This is safe because the\ndrop checks run before the buffer is synced for CPU access or\nprefetched. The discard-path change and the in-place reuse apply with or\nwithout an XDP program attached.\n\nThe !error guard on the discard check also changes the accounting for\nerrored multi-descriptor frames on dwmac100/dwmac1000: rx_errors is\nincremented once per frame instead of once per descriptor. This too is\nindependent of XDP mode.\n\nNote: the subsequent \"net: stmmac: rework stmmac_rx to support XDP rx\nmulti-buff\" accumulates the whole frame into a single xdp_buff and\nsupersedes this patch; the fix is kept so the net portion of the series\nstands on its own."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"5fabb01207a2d3439a6abe1d08640de9c942945f","status":"affected","lessThan":"ffa7563878f8a52390ea50a3994df0d2a588ae0b","versionType":"git"},{"version":"5fabb01207a2d3439a6abe1d08640de9c942945f","status":"affected","lessThan":"10f01285eb9db4a92ecb927273dd332e217265ac","versionType":"git"},{"version":"5fabb01207a2d3439a6abe1d08640de9c942945f","status":"affected","lessThan":"52ffd771e0029c5ad0504b1b4a8b7f932b65eea3","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/net/ethernet/stmicro/stmmac/stmmac_main.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.13","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.13","versionType":"semver"},{"version":"6.18.66","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.7","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc2","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/stmmac_main.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/ffa7563878f8a52390ea50a3994df0d2a588ae0b"},{"url":"https://git.kernel.org/stable/c/10f01285eb9db4a92ecb927273dd332e217265ac"},{"url":"https://git.kernel.org/stable/c/52ffd771e0029c5ad0504b1b4a8b7f932b65eea3"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-12-03T09:22:03.891Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.13","versionEndExcluding":"6.18.66"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.13","versionEndExcluding":"7.3.7"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.13","versionEndExcluding":"7.4-rc2"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}