All of lore.kernel.org
 help / color / mirror / Atom feed
* CVE-2026-143346: net: stmmac: take ownership of saved RX state at poll entry
@ 2026-12-03  9:23 Greg Kroah-Hartman
  0 siblings, 0 replies; only message in thread
From: Greg Kroah-Hartman @ 2026-12-03  9:23 UTC (permalink / raw)
  To: linux-cve-announce; +Cc: Greg Kroah-Hartman

From: Greg Kroah-Hartman <gregkh@kernel.org>

Description
===========

In 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.

The Linux kernel CVE team has assigned CVE-2026-143346 to this issue.


Affected and fixed versions
===========================

	Issue introduced in 5.4 with commit ec222003bd948de8f3ffbca522d328af1a8452ad and fixed in 6.18.66 with commit f28cacf31e8a344b2f451a48bb1d21be94c435bd
	Issue introduced in 5.4 with commit ec222003bd948de8f3ffbca522d328af1a8452ad and fixed in 7.3.7 with commit e0abe47f4db994354d5b8d54fc20540cdd13258c
	Issue introduced in 5.4 with commit ec222003bd948de8f3ffbca522d328af1a8452ad and fixed in 7.4-rc2 with commit 26219e9402c22181f021034f127a8e278d40545f

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-143346
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/f28cacf31e8a344b2f451a48bb1d21be94c435bd
	https://git.kernel.org/stable/c/e0abe47f4db994354d5b8d54fc20540cdd13258c
	https://git.kernel.org/stable/c/26219e9402c22181f021034f127a8e278d40545f

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-12-03  9:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03  9:23 CVE-2026-143346: net: stmmac: take ownership of saved RX state at poll entry Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.