From: Cong Wang <xiyou.wangc...@gmail.com> Date: Thu, 26 Oct 2017 18:24:27 -0700
> Recently, the RCU callbacks used in TC filters and TC actions keep > drawing my attention, they introduce at least 4 race condition bugs: ... > As suggested by Paul, we could defer the work to a workqueue and > gain the permission of holding RTNL again without any performance > impact, however, in tcf_block_put() we could have a deadlock when > flushing workqueue while hodling RTNL lock, the trick here is to > defer the work itself in workqueue and make it queued after all > other works so that we keep the same ordering to avoid any > use-after-free. Please see the first patch for details. > > Patch 1 introduces the infrastructure, patch 2~12 move each > tc filter to the new tc filter workqueue, patch 13 adds > an assertion to catch potential bugs like this, patch 14 > closes another rcu callback race, patch 15 and patch 16 add > new test cases. I know Eric has some reservations about how things have become in this layer, but we have to fix this for 'net' somehow. So I've applied this series, thanks.