[PATCH net-next v2 0/2] net/stmmac: Fix panic during interface shutdown & apply STMMAC_DOWN flag
From: Jakub Raczynski
Date: Mon Jun 01 2026 - 12:43:07 EST
When testing interface shutdown during XDP operation using stmmac driver,
we have encountered kernel panics, either poison overwritten or wrong
memory access, caused by NAPI processing data after shutting down NAPI.
Fix this racing condition by ensuring data has been processed.
After discussions and some checks, it seems that problem with shutting down
interface during NAPI processing is universal, but is very hard to trigger.
Originally this patch was targetting XDP shutdown, but kernel panic is possible
in every use case.
Although this patchset contains 'fix' in title, it is so hard to trigger that
it is not critical, since it requires shutting down interface during
heavy traffic and testing this requires looping up/down for long time.
It can happen in the wild, as happened originally, but reproducing it is tough.
---
Link to v1:
https://lore.kernel.org/all/20260511165045.3091475-1-j.raczynski@xxxxxxxxxxx/
Changes in v2:
- Split patch into two: one for XDP paths and second for general fix
- Change commit messages & title
- Fix all cases of NAPI release, not only XDP, via modyfying
stmmac_disable_all_queues() instead of separate later call
- Drop setting/clearing of STMMAC_DOWN flag in release()/open()
Jakub Raczynski (2):
net/stmmac: Check for STMMAC_DOWN flag in all XDP paths
net/stmmac: Fix free-after-use panic when interface goes does
.../net/ethernet/stmicro/stmmac/stmmac_main.c | 20 +++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
--
2.34.1