]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_tables: restore synchronous object release from commit/abort
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 10 Nov 2014 20:14:12 +0000 (21:14 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 12 Nov 2014 11:06:24 +0000 (12:06 +0100)
commit4e47f7209cebfcf7164777fdc19f630676669835
tree3da47178073b5ef4c15198df0baa1ac7eb66954e
parentcb4170ca4a90f166c4cdc81adbfda41a794cef88
netfilter: nf_tables: restore synchronous object release from commit/abort

The existing xtables matches and targets, when used from nft_compat, may
sleep from the destroy path, ie. when removing rules. Since the objects
are released via call_rcu from softirq context, this results in lockdep
splats and possible lockups that may be hard to reproduce.

Patrick also indicated that delayed object release via call_rcu can
cause us problems in the ordering of event notifications when anonymous
sets are in place.

So, this patch restores the synchronous object release from the commit
and abort paths. This includes a call to synchronize_rcu() to make sure
that no packets are walking on the objects that are going to be
released. This is slowier though, but it's simple and it resolves the
aforementioned problems.

This is a partial revert of 9eb18c4 ("netfilter: nf_tables: defer all
object release via rcu") that was introduced in 3.16 to speed up
interaction with userspace.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netfilter/nf_tables.h
net/netfilter/nf_tables_api.c