diff options
author | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2012-02-24 05:45:49 -0500 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2012-02-24 06:24:15 -0500 |
commit | 7d367e06688dc7a2cc98c2ace04e1296e1d987e2 (patch) | |
tree | bf4a9a6497dec37fdd4a31999cb218277e2ba656 /include | |
parent | 279072882dc0149e5740dace075e1a49f087046d (diff) |
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/netfilter/nf_conntrack.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index 8a2b0ae7dbd2..ab86036bbf0c 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
@@ -209,7 +209,7 @@ extern struct nf_conntrack_tuple_hash * | |||
209 | __nf_conntrack_find(struct net *net, u16 zone, | 209 | __nf_conntrack_find(struct net *net, u16 zone, |
210 | const struct nf_conntrack_tuple *tuple); | 210 | const struct nf_conntrack_tuple *tuple); |
211 | 211 | ||
212 | extern void nf_conntrack_hash_insert(struct nf_conn *ct); | 212 | extern int nf_conntrack_hash_check_insert(struct nf_conn *ct); |
213 | extern void nf_ct_delete_from_lists(struct nf_conn *ct); | 213 | extern void nf_ct_delete_from_lists(struct nf_conn *ct); |
214 | extern void nf_ct_insert_dying_list(struct nf_conn *ct); | 214 | extern void nf_ct_insert_dying_list(struct nf_conn *ct); |
215 | 215 | ||