diff options
author | Cong Wang <[email protected]> | 2019-02-16 10:58:26 -0800 |
---|---|---|
committer | David S. Miller <[email protected]> | 2019-02-20 20:11:10 -0800 |
commit | 3d210534cc93dab39a9d1a8d674aa2872c268d38 (patch) | |
tree | b2c64f1f04e65965284581675b8ee1d122763ae2 /tools/perf/scripts/python/exported-sql-viewer.py | |
parent | 418e897e0716b238ea4252ed22a73ca37d3cbbc1 (diff) |
net_sched: fix a race condition in tcindex_destroy()
(cherry picked from commit 8015d93ebd27484418d4952284fd02172fa4b0b2)
tcindex_destroy() invokes tcindex_destroy_element() via
a walker to delete each filter result in its perfect hash
table, and tcindex_destroy_element() calls tcindex_delete()
which schedules tcf RCU works to do the final deletion work.
Unfortunately this races with the RCU callback
__tcindex_destroy(), which could lead to use-after-free as
reported by Adrian.
Fix this by migrating this RCU callback to tcf RCU work too,
as that workqueue is ordered, we will not have use-after-free.
Note, we don't need to hold netns refcnt because we don't call
tcf_exts_destroy() here.
Fixes: 27ce4f05e2ab ("net_sched: use tcf_queue_work() in tcindex filter")
Reported-by: Adrian <[email protected]>
Cc: Ben Hutchings <[email protected]>
Cc: Jamal Hadi Salim <[email protected]>
Cc: Jiri Pirko <[email protected]>
Signed-off-by: Cong Wang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions