[RFC PATCH net 0/2] net/ncsi: tighten RCU-list lifetime handling
From: Runyu Xiao <hidden>
Date: 2026-06-27 09:27:32
Also in:
lkml
Hi, This small RFC series addresses two NCSI RCU-list lifetime issues. The candidates were found by our static analysis tool and then manually reviewed against the current tree. CONFIG_PROVE_RCU_LIST was used as target-matched triage evidence; the RFC patches below are based on the source-level lifetime review rather than on the dynamic warning alone. Patch 1 defers freeing VLAN filter entries removed with list_del_rcu(). The NCSI configuration workqueue is a real RCU reader of the same list in set_one_vid(), so RTNL serialization of VLAN add/delete callbacks is not enough to protect that reader. Patch 2 moves the existing NCSI device workqueue shutdown before package/channel teardown and clears channel_queue while the channel objects are still alive. Current trees already disable the work item before freeing ndp itself, but still free channels before disable_work_sync(). NCSI work can walk the package/channel lists and channel_queue during that window. I am sending this as RFC because I have not tested it on NCSI hardware, and maintainers should confirm whether additional request timer cancellation or RCU-delayed package/channel release is desirable for the unregister path. The patches intentionally do not claim a standalone exploitable UAF. The evidence is a source-level lifetime risk plus target-matched CONFIG_PROVE_RCU_LIST warnings for the affected NCSI helpers. Runyu Xiao (2): net/ncsi: defer freeing VLAN filter entries after RCU removal net/ncsi: stop device work before freeing channels net/ncsi/internal.h | 1 + net/ncsi/ncsi-manage.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) -- 2.34.1