net: stmmac: take ownership of saved RX state at poll entry

Summary

CVECVE-2026-143346
StatePUBLISHED
AssignerLinux
Source PriorityCVE Program / NVD first with legacy fallback
Published2026-12-03 10:18:23 UTC
Updated2026-12-03 10:18:23 UTC
DescriptionIn the Linux kernel, the following vulnerability has been resolved: net: stmmac: take ownership of saved RX state at poll entry When a saved partial packet completes with a poll budget of one, the old loop can leave state_saved and state.skb pointing at an skb that has already been delivered or freed. The next poll then reuses that pointer, causing a use-after-free or double free. Take the saved state at poll entry and clear the stored ownership immediately. Save it again only if the packet remains incomplete, including when the next descriptor is still DMA-owned. Track the frame-in-progress flag independently of the status read from the next descriptor. The old code keyed the save on the status of the last descriptor looked at, so a loop stopped at a DMA-owned descriptor (rx status not yet valid) could drop the saved error/length bookkeeping in stmmac_rx_zc(). Drop the saved state both when the queue parameters are reset and when the ring is destroyed. stmmac_reset_rx_queue() is reached from __stmmac_open(), stmmac_xdp_open(), stmmac_resume() and stmmac_enable_rx_queue(); without draining it there, a partial frame saved before suspend (or before a queue is disabled and re-enabled) survives while cur_rx and dirty_rx are rewound to zero. On the resume path the ring is only re-armed in place: stmmac_clear_descriptors() sets the ownership bits and stmmac_init_dma_engine() restores the tail pointer, but the RX buffer addresses are not reprogrammed. The first poll would then resume the stale skb against a ring position that no longer matches the descriptors it was built from. __free_dma_rx_desc_resources() releases it on teardown. Apply the same state handling to stmmac_rx_zc(), which also leaves state_saved set when a saved frame finishes at the budget boundary. That path saves only error and length bookkeeping, not an skb pointer.

Vendor Declared Affected Products

SourceVendorProductVersionPlatforms
CNA Linux Linux affected ec222003bd948de8f3ffbca522d328af1a8452ad f28cacf31e8a344b2f451a48bb1d21be94c435bd git Not specified
CNA Linux Linux affected ec222003bd948de8f3ffbca522d328af1a8452ad e0abe47f4db994354d5b8d54fc20540cdd13258c git Not specified
CNA Linux Linux affected ec222003bd948de8f3ffbca522d328af1a8452ad 26219e9402c22181f021034f127a8e278d40545f git Not specified
CNA Linux Linux affected 5.4 Not specified
CNA Linux Linux unaffected 5.4 semver Not specified
CNA Linux Linux unaffected 6.18.66 6.18.* semver Not specified
CNA Linux Linux unaffected 7.3.7 7.3.* semver Not specified
CNA Linux Linux unaffected 7.4-rc2 * original_commit_for_fix Not specified

References

ReferenceSourceLinkTags
git.kernel.org/stable/c/e0abe47f4db994354d5b8d54fc20540cdd13258c 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/26219e9402c22181f021034f127a8e278d40545f 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/f28cacf31e8a344b2f451a48bb1d21be94c435bd 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
CVE Program record CVE.ORG www.cve.org canonical
NVD vulnerability detail NVD nvd.nist.gov canonical, analysis

© CVE.report 2026

Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. It is the responsibility of user to evaluate the accuracy, completeness or usefulness of any information, opinion, advice or other content. EACH USER WILL BE SOLELY RESPONSIBLE FOR ANY consequences of his or her direct or indirect use of this web site. ALL WARRANTIES OF ANY KIND ARE EXPRESSLY DISCLAIMED. This site will NOT BE LIABLE FOR ANY DIRECT, INDIRECT or any other kind of loss.

CVE, CWE, and OVAL are registred trademarks of The MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. This site includes MITRE data granted under the following license.

Free CVE JSON API cve.report/api

CVE.report and Source URL Uptime Status status.cve.report