Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: sched: consistently use rcu_replace_pointer() in taprio_change()

According to Vinicius (and carefully looking through the whole
https://syzkaller.appspot.com/bug?extid=b65e0af58423fc8a73aa
once again), txtime branch of 'taprio_change()' is not going to
race against 'advance_sched()'. But using 'rcu_replace_pointer()'
in the former may be a good idea as well.

Suggested-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Acked-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Dmitry Antipov and committed by
David S. Miller
d5c45460 f7232247

+3 -1
+3 -1
net/sched/sch_taprio.c
··· 1952 1952 goto unlock; 1953 1953 } 1954 1954 1955 - rcu_assign_pointer(q->admin_sched, new_admin); 1955 + /* Not going to race against advance_sched(), but still */ 1956 + admin = rcu_replace_pointer(q->admin_sched, new_admin, 1957 + lockdep_rtnl_is_held()); 1956 1958 if (admin) 1957 1959 call_rcu(&admin->rcu, taprio_free_sched_cb); 1958 1960 } else {