netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: 2.6.0-test9 : bridge freezes
@ 2003-12-15 13:15 Steve Hill
  2003-12-16  1:17 ` David S. Miller
  0 siblings, 1 reply; 11+ messages in thread
From: Steve Hill @ 2003-12-15 13:15 UTC (permalink / raw)
  To: netdev

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1200 bytes --]


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;

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?

Bart De Schuymer suggested that they should be freed in 
skbuff.c::skb_release_data(), but having looked at this it seems to do 
this already.  skb_release_data() calls skb_drop_fraglist(), which does 
kfree_skb() on each fragment, and kfree_skb calls nf_bridge_put correctly 
so this isn't the problem.

-- 

- Steve Hill
Senior Software Developer                        Email: steve@navaho.co.uk
Navaho Technologies Ltd.                           Tel: +44-870-7034015

        ... Alcohol and calculus don't mix - Don't drink and derive! ...


[-- Attachment #2: Type: TEXT/PLAIN, Size: 565 bytes --]

diff -urN linux-2.6.0-test11.vanilla/net/ipv4/ip_fragment.c linux-2.6.0-test11/net/ipv4/ip_fragment.c
--- linux-2.6.0-test11.vanilla/net/ipv4/ip_fragment.c	2003-12-12 19:27:07.000000000 +0000
+++ linux-2.6.0-test11/net/ipv4/ip_fragment.c	2003-12-15 08:49:01.000000000 +0000
@@ -592,6 +592,9 @@
 	atomic_sub(head->truesize, &ip_frag_mem);
 
 	for (fp=head->next; fp; fp = fp->next) {
+#ifdef CONFIG_BRIDGE_NETFILTER
+		nf_bridge_put(fp->nf_bridge);
+#endif
 		head->data_len += fp->len;
 		head->len += fp->len;
 		if (head->ip_summed != fp->ip_summed)

^ permalink raw reply	[flat|nested] 11+ messages in thread
[parent not found: <200311221527.UAA29684@eis.iisc.ernet.in>]

end of thread, other threads:[~2003-12-17 18:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-15 13:15 2.6.0-test9 : bridge freezes Steve Hill
2003-12-16  1:17 ` David S. Miller
2003-12-16  7:43   ` Bart De Schuymer
2003-12-16  7:46     ` David S. Miller
2003-12-16  9:00     ` Steve Hill
2003-12-16 21:46       ` Bart De Schuymer
2003-12-16 21:49         ` David S. Miller
2003-12-17  8:36         ` Steve Hill
2003-12-17 18:27           ` Bart De Schuymer
     [not found] <200311221527.UAA29684@eis.iisc.ernet.in>
2003-11-22 16:20 ` Linus Torvalds
2003-11-23 23:26   ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).