net/sched: sch_fq_codel: remove data-races from fq_codel_dump_stats()
Subsystems (3)
PATCH 1/1 net/sched: sch_fq_codel: remove data-races from fq_codel_dump_stats()
fq_codel_dump_stats() acquires the qdisc spinlock a bit too late.
Move this acquisition before we fill st.qdisc_stats with live data.
Fixes edb09eb17ed8 ("net: sched: do not acquire qdisc spinlock in qdisc/class stats dump")
Signed-off-by Eric Dumazet <[email protected]>
Reviewed-by Jamal Hadi Salim <[email protected]>
--- net/sched/sch_fq_codel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/sched/sch_fq_codel.c +2 -1
@@ -585,6 +585,8 @@ static int fq_codel_dump_stats(struct Qdisc *sch, struct gnet_dump *d) };struct list_head *pos; +sch_tree_lock (sch); + st.qdisc_stats.maxpacket = q->cstats.maxpacket; st.qdisc_stats.drop_overlimit = q->drop_overlimit; st.qdisc_stats.ecn_mark = q->cstats.ecn_mark;
@@ -593,7 +595,6 @@ static int fq_codel_dump_stats(struct Qdisc *sch, struct gnet_dump *d) st.qdisc_stats.memory_usage = q->memory_usage; st.qdisc_stats.drop_overmemory = q->drop_overmemory; -sch_tree_lock (sch);list_for_each (pos, &q->new_flows) st.qdisc_stats.new_flows_len++;
Signature · 1 line
2.54.0.rc2.533.g4f5dca5207-goog
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Tue, 21 Apr 2026 14:25:09 +0000 you wrote:
fq_codel_dump_stats()acquires the qdisc spinlock a bit too late.Move this acquisition before we fill st.qdisc_stats with live data.
Fixes edb09eb17ed8 ("net: sched: do not acquire qdisc spinlock in qdisc/class stats dump")Signed-off-by Eric Dumazet <[email protected]>Reviewed-by Jamal Hadi Salim <[email protected]>[...]
Here is the summary with links:
- [net] net/sched: sch_fq_codel: remove data-races from fq_codel_dump_stats()
https://git.kernel.org/netdev/net/c/bbfaa73ea687
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html