]> git.baikalelectronics.ru Git - kernel.git/commit
net_sched: acquire RTNL in tc_action_net_exit()
authorCong Wang <xiyou.wangcong@gmail.com>
Wed, 1 Nov 2017 17:23:49 +0000 (10:23 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 3 Nov 2017 01:30:38 +0000 (10:30 +0900)
commit0afe63e58c854ae1b30b0c5f8cf92a9587ca3b80
treebbc6afb3b37bb06103e40b963eca79685bc49768
parentb427c6a7dcea353979e2c62593c6473d8a111e9e
net_sched: acquire RTNL in tc_action_net_exit()

I forgot to acquire RTNL in tc_action_net_exit()
which leads that action ops->cleanup() is not always
called with RTNL. This usually is not a big deal because
this function is called after all netns refcnt are gone,
but given RTNL protects more than just actions, add it
for safety and consistency.

Also add an assertion to catch other potential bugs.

Fixes: 22213dff9d4e ("net_sched: add network namespace support for tc actions")
Reported-by: Lucas Bates <lucasb@mojatatu.com>
Tested-by: Lucas Bates <lucasb@mojatatu.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/act_api.h
net/sched/act_api.c