public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Eric Dumazet <dada1@cosmosbay•com>
To: Graham Murray <graham@gmurray•org.uk>,
	"David S. Miller" <davem@davemloft•net>
Cc: linux-kernel@vger•kernel.org, Linux Netdev List <netdev@vger•kernel.org>
Subject: [PATCH] netfilter: ip6tables fix
Date: Sun, 05 Apr 2009 14:29:57 +0200	[thread overview]
Message-ID: <49D8A445.4060201@cosmosbay.com> (raw)
In-Reply-To: <49D88839.4090902@cosmosbay.com>

Eric Dumazet a écrit :
> Graham Murray a écrit :
>> iptables gives me no problems at all, it is just ip6tables that
>> fails. The first indication of this is during the init scripts when
>> ip6tables-restore fails.
> 
> I see, its a plain bug in net/ipv6/netfilter/ip6_tables.c
> function alloc_counters() always returns -ENOMEM
> 
> Unfortunatly , its Sunday here and I have to run for lunch time with family :)
> 
> If nobody beats me, I will do the fix in a couple of hours...

Here is the fix, thanks Graham for the report !

[PATCH] netfilter: ip6tables fix

ip6_tables.c	 alloc_counters() misses a return statement, making
ip6tables -N always failing and leaking memory.

Reported-by: Graham Murray <graham@gmurray•org.uk>
Signed-off-by: Eric Dumazet <dada1@cosmosbay•com>
---

diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
index dfed176..800ae85 100644
--- a/net/ipv6/netfilter/ip6_tables.c
+++ b/net/ipv6/netfilter/ip6_tables.c
@@ -1033,6 +1033,8 @@ static struct xt_counters *alloc_counters(struct xt_table *table)
 
 	xt_free_table_info(info);
 
+	return counters;
+
  free_counters:
 	vfree(counters);
  nomem:


  reply	other threads:[~2009-04-05 12:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20090329234702.4988017f@desktop.r000n.info>
     [not found] ` <8763hja8cy.fsf@newton.gmurray.org.uk>
2009-04-05  8:22   ` Regression caused by commit "netfilter: iptables: lock free counters" David Miller
2009-04-05 10:01     ` Eric Dumazet
     [not found]       ` <87ws9z8l4c.fsf@newton.gmurray.org.uk>
2009-04-05 10:30         ` Eric Dumazet
2009-04-05 12:29           ` Eric Dumazet [this message]
2009-04-05 12:40             ` [PATCH] netfilter: ip6tables fix Eric Dumazet
2009-04-06 15:08               ` Patrick McHardy
2009-04-05 11:36       ` Regression caused by commit "netfilter: iptables: lock free counters" Jan Engelhardt
2009-04-05 12:34         ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49D8A445.4060201@cosmosbay.com \
    --to=dada1@cosmosbay$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=graham@gmurray$(echo .)org.uk \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox