]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: ctnetlink: fix soft lockup when netlink adds new entries (v2)
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Fri, 24 Feb 2012 10:45:49 +0000 (11:45 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 24 Feb 2012 11:24:15 +0000 (12:24 +0100)
commitdbe4dd0f6c955e622b651cba4ec1063ed9b7829a
treebf4a9a6497dec37fdd4a31999cb218277e2ba656
parentb4986029c43081382ca0293a7d3bce7d3ddaf7eb
netfilter: ctnetlink: fix soft lockup when netlink adds new entries (v2)

Marcell Zambo and Janos Farago noticed and reported that when
new conntrack entries are added via netlink and the conntrack table
gets full, soft lockup happens. This is because the nf_conntrack_lock
is held while nf_conntrack_alloc is called, which is in turn wants
to lock nf_conntrack_lock while evicting entries from the full table.

The patch fixes the soft lockup with limiting the holding of the
nf_conntrack_lock to the minimum, where it's absolutely required.
It required to extend (and thus change) nf_conntrack_hash_insert
so that it makes sure conntrack and ctnetlink do not add the same entry
twice to the conntrack table.

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netfilter/nf_conntrack.h
net/netfilter/nf_conntrack_core.c
net/netfilter/nf_conntrack_netlink.c