summaryrefslogtreecommitdiffstats
path: root/Kconfig
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2019-01-14 14:28:49 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2019-01-18 02:29:42 +0100
commitcf52572ebbd7189a1966c2b5fc34b97078cd1dce (patch)
tree3918bdccec2d051efafea9bc3735896578fd9c72 /Kconfig
parent12c44aba6618b7f6c437076e5722237190f6cd5f (diff)
downloadblackbird-obmc-linux-cf52572ebbd7189a1966c2b5fc34b97078cd1dce.tar.gz
blackbird-obmc-linux-cf52572ebbd7189a1966c2b5fc34b97078cd1dce.zip
netfilter: nft_compat: make lists per netns
There are two problems with nft_compat since the netlink config plane uses a per-netns mutex: 1. Concurrent add/del accesses to the same list 2. accesses to a list element after it has been free'd already. This patch fixes the first problem. Freeing occurs from a work queue, after transaction mutexes have been released, i.e., it still possible for a new transaction (even from same net ns) to find the to-be-deleted expression in the list. The ->destroy functions are not allowed to have any such side effects, i.e. the list_del() in the destroy function is not allowed. This part of the problem is solved in the next patch. I tried to make this work by serializing list access via mutex and by moving list_del() to a deactivate callback, but Taehee spotted following race on this approach: NET #0 NET #1 >select_ops() ->init() ->select_ops() ->deactivate() ->destroy() nft_xt_put() kfree_rcu(xt, rcu_head); ->init() <-- use-after-free occurred. Unfortunately, we can't increment reference count in select_ops(), because we can't undo the refcount increase in case a different expression fails in the same batch. (The destroy hook will only be called in case the expression was initialized successfully). Fixes: f102d66b335a ("netfilter: nf_tables: use dedicated mutex to guard transactions") Reported-by: Taehee Yoo <ap420073@gmail.com> Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'Kconfig')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud