]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net/sched: sch_teql: move rcu_read_lock()/spin_lock() from _bh variants
authorJamal Hadi Salim <jhs@mojatatu.com>
Tue, 30 Jun 2026 15:09:22 +0000 (11:09 -0400)
committerPaolo Abeni <pabeni@redhat.com>
Fri, 3 Jul 2026 14:02:38 +0000 (16:02 +0200)
commit6301f6a34ed86fe6f3b7b3211ea069f3677fc559
treee3dbba3ea0b07dda49f29a7751042efcb2904e20
parentd335dcc6f521571d57117b8deeebc940836e5450
net/sched: sch_teql: move rcu_read_lock()/spin_lock() from _bh variants

This is a followup based on sashiko comments [1] on commit e5b811fe7931
("net/sched: sch_teql: Introduce slaves_lock to avoid race condition and UAF")

Use plain rcu_read_lock()/spin_lock() in teql_master_xmit() instead of the
_bh variants, since ndo_start_xmit is already invoked with BH disabled
by the core stack and the _bh primitives can warn in_hardirq() when xmit
is reached through netpoll or a softirq xmit path with hard IRQs disabled.

Moves rcu_read_lock() after restart: label + adds rcu_read_unlock() before
goto restart (fixes the unbounded RCU hold across retries)

[1] https://sashiko.dev/#/patchset/20260628111229.669751-1-jhs%40mojatatu.com

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Fixes: e5b811fe7931 ("net/sched: sch_teql: Introduce slaves_lock to avoid race condition and UAF")
Link: https://patch.msgid.link/20260630150922.238714-1-jhs@mojatatu.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/sched/sch_teql.c