From: Bart De Schuymer <bdschuym@pandora.be>
To: Steve Hill <steve@navaho.co.uk>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
<ebtables-devel@lists.sourceforge.net>,
<netfilter-devel@lists.netfilter.org>
Subject: Re: memory leak related to bridging, conntrack and frags in 2.6.0
Date: Sun, 14 Dec 2003 00:35:38 +0100 [thread overview]
Message-ID: <200312140035.38759.bdschuym@pandora.be> (raw)
In-Reply-To: <Pine.LNX.4.44.0312121948321.8670-200000@sorbus2.navaho>
On Friday 12 December 2003 20:55, Steve Hill wrote:
> Sorry for the cross-post - I thought this would be of interest to all the
> lists and also wasn't sure where the best people to help hang out.
The right mailing list for this is netdev@oss.sgi.com.
> With both conntrack and bridging turned on in the 2.6.0test11 kernel,
> sending fragmented packets over the bridge reveals a memory leak
> (specifically, forwarding packets from any interface to a bridge). The
> memory that is leaking seems to be being allocated on line 299 on
> net/bridge/br_netfilter.c:
>
> if ((nf_bridge = nf_bridge_alloc(skb)) == NULL)
> return NF_DROP;
Thanks for the good diagnose.
> Only the first fragment gets freed later on.
>
> The patch attached fixes the problem by freeing nf_bridge when the
> packets are defragmented, however I am sure this is not the right place
> to do this. Where would the skb's for the fragments usually get freed?
I believe they are freed in skbuff.c::skb_release_data().
I think the place where you've put the fix doesn't cover all cases. If
ip_frag_destroy() is called, there will still be a memory leak. So I think
the right place for this is in skb_release_data. But consulting with the
netdev list seems appropriate :)
You can change
+ if (fp->nf_bridge) {
+ nf_bridge_put(fp->nf_bridge);
+ fp->nf_bridge = NULL;
+ };
into
+ nf_bridge_put(fp->nf_bridge);
cheers,
Bart
prev parent reply other threads:[~2003-12-13 23:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-12 19:55 Steve Hill
2003-12-13 23:35 ` Bart De Schuymer [this message]
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=200312140035.38759.bdschuym@pandora.be \
--to=bdschuym@pandora.be \
--cc=ebtables-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netfilter-devel@lists.netfilter.org \
--cc=steve@navaho.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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
all inboxes | Powered by JetHome®