aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/scripts/Makefile.thinlto
diff options
context:
space:
mode:
authorThéo Lebrun <theo.lebrun@bootlin.com>2026-10-13 15:16:39 +0200
committerPaolo Abeni <pabeni@redhat.com>2026-10-20 09:30:24 +0200
commitba16ad3c87691468bcbbecef7e0ceab059eea222 (patch)
tree883c002ec3e19b8ac8def6219480687549a3c0d6 /scripts/Makefile.thinlto
parentMerge branch 'net-rnpgbe-add-tx-rx-and-link-status-support' (diff)
net: macb: close race between NAPI polls & ndo_stop
In ndo_close, we call napi_disable() then free the ring buffers queue->rx_ring|tx_ring. In the NAPI poll functions, after napi_complete_done() we might enable interrupts and might re-check the next ring buffer slot. This is a use-after-free race on our ring buffers because napi_disable() only waits for napi_complete_done() to return, it does not wait for NAPI poll functions to finish. The poll function sequence must stay as-is, see commit 0bf476fc3624 ("net: macb: Fix lost RX packet wakeup race in NAPI receive") which explains why the sequence must be napi_complete_done() -> arm IRQs -> re-check ring slot. Fix by waiting for full end of NAPI poll functions using synchronize_net() in our ndo_close implementation. This bug has never been reproduced and was reported by Sashiko. The chances of facing it in practice sound tiny: it needs a system without any phylink attached, running PREEMPT_RT and with a kernel preemption on the NAPI poll at the right instant. We fix it here before introducing context swapping, which is another place where the race could appear (and Sashiko complains on this series). Fixes: 138badbc21a0 ("net: macb: use NAPI for TX completion path") Fixes: 1900e30d0ef7 ("net: macb: simplify/cleanup NAPI reschedule checking") Cc: stable+noautosel@kernel.org # too unlikely and never reported by users Reported-by: Sashiko <sashiko-bot@kernel.org> Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261001-macb-context-v10-0-beb541bbb7df%40bootlin.com?part=7 Link: https://lore.kernel.org/all/179115680572.434549.1016291990685937691@kernel.org/ Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com> Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de> Link: https://patch.msgid.link/20261013-macb-context-v11-1-b27785167566@bootlin.com Tested-by: Nicolai Buchwitz <nb@tipi-net.de> # RPi CM5 with RP1 GEM Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions