net_sched: fix a missing rcu barrier in mini_qdisc_pair_swap()
authorCong Wang <xiyou.wangcong@gmail.com>
Thu, 21 Dec 2017 07:26:24 +0000 (23:26 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 26 Dec 2017 17:28:40 +0000 (12:28 -0500)
commitb2fb01f426883a794ed80be9110675a2d8356347
tree27c6f9bc0269903fe480f9a69530fd3ea0e08d22
parentc1a8d0a3accf64a014d605e6806ce05d1c17adf1
net_sched: fix a missing rcu barrier in mini_qdisc_pair_swap()

The rcu_barrier_bh() in mini_qdisc_pair_swap() is to wait for
flying RCU callback installed by a previous mini_qdisc_pair_swap(),
however we miss it on the tp_head==NULL path, which leads to that
the RCU callback still uses miniq_old->rcu after it is freed together
with qdisc in qdisc_graft(). So just add it on that path too.

Fixes: 46209401f8f6 ("net: core: introduce mini_Qdisc and eliminate usage of tp->q for clsact fastpath ")
Reported-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Tested-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: Jiri Pirko <jiri@mellanox.com>
Cc: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_generic.c