]> git.proxmox.com Git - mirror_ubuntu-zesty-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)
commitb326dd37b94e29bf6a15940f4fa66aa21a678ab1
tree3da47178073b5ef4c15198df0baa1ac7eb66954e
parentafefb6f928ed42d5db452ee9251ce6de62673c67
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 c7c32e7 ("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