From: Pablo Neira Ayuso Date: Tue, 3 Apr 2012 14:45:54 +0000 (+0200) Subject: netfilter: nf_conntrack: fix count leak in error path of __nf_conntrack_alloc X-Git-Tag: v3.12-rc1~3454^2~29 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d96fc659aeb27686cef42d305cfd0c9702f8841c;p=kernel%2Fkernel-generic.git netfilter: nf_conntrack: fix count leak in error path of __nf_conntrack_alloc We have to decrement the conntrack counter if we fail to access the zone extension. Reported-by: Tetsuo Handa Signed-off-by: Pablo Neira Ayuso Signed-off-by: David S. Miller --- diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index cbdb754..3cc4487 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c @@ -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