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-Url: https://git.stricted.de/?a=commitdiff_plain;h=d96fc659aeb27686cef42d305cfd0c9702f8841c;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.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 cbdb754dbb10..3cc4487ac349 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