Skip to content

Commit

Permalink
netfilter: nf_conntrack: fix count leak in error path of __nf_conntra…
Browse files Browse the repository at this point in the history
…ck_alloc

We have to decrement the conntrack counter if we fail to access the
zone extension.

Reported-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pablo Neira Ayuso authored and David S. Miller committed Apr 3, 2012
1 parent ee14186 commit d96fc65
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/netfilter/nf_conntrack_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,7 @@ __nf_conntrack_alloc(struct net *net, u16 zone,

#ifdef CONFIG_NF_CONNTRACK_ZONES
out_free:
atomic_dec(&net->ct.count);
kmem_cache_free(net->ct.nf_conntrack_cachep, ct);
return ERR_PTR(-ENOMEM);
#endif
Expand Down

0 comments on commit d96fc65

Please sign in to comment.