Skip to content

Commit d5c4546

Browse files
dmantipovdavem330
authored andcommitted
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>
1 parent f723224 commit d5c4546

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net/sched/sch_taprio.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1952,7 +1952,9 @@ static int taprio_change(struct Qdisc *sch, struct nlattr *opt,
19521952
goto unlock;
19531953
}
19541954

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());
19561958
if (admin)
19571959
call_rcu(&admin->rcu, taprio_free_sched_cb);
19581960
} else {

0 commit comments

Comments
 (0)