netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: vincent-perrier@club-internet.fr
Cc: yoshfuji@linux-ipv6.org, netdev@vger.kernel.org
Subject: Re: 2.6.25-rc8: FTP transfer errors
Date: Fri, 18 Apr 2008 01:32:28 -0700 (PDT)	[thread overview]
Message-ID: <20080418.013228.155392171.davem@davemloft.net> (raw)
In-Reply-To: <20080410.164106.192045155.davem@davemloft.net>

From: David Miller <davem@davemloft.net>
Date: Thu, 10 Apr 2008 16:41:06 -0700 (PDT)

> From: vincent-perrier <vincent-perrier@club-internet.fr>
> Date: Fri, 11 Apr 2008 01:32:14 +0200
> 
> > Even if the patch is not good, the line dst_free(&rt->u.dst); 
> > when rt is still in tree leads to a crash, but when you do not
> > do the dst_free, when rt is in tree, then it may have hidden 
> > other bugs, but at least I can keep working.
> > 
> > 
> > I never said my patch was good, but it does the minimum to avoid my bug:
> > 
> > 
> >                 if (fn->leaf == NULL) {
> >                         bug_8895_clownix_provisional_workaround = 1;
> >                         fn->leaf = rt;
> >                         atomic_inc(&rt->rt6i_ref);
> >                 }
> > ...
> > 
> > ip6_fib.c, line 796:
> > 
> >                 if (!bug_8895_clownix_provisional_workaround)
> >                         dst_free(&rt->u.dst);
> > 
> > That way at least it does not crash.

I started looking actively at this.

There are a lot of complicated side effects here, especially when
subtrees are enabled as it is in your case.

The main issue is whether we added any references to 'rt' into
the routing tree.  If we get an error, we have to undo any
such added references.

And that's not being done when the "if (fn->leaf == NULL)" code
runs and fib6_add_rt2node() returns an error.

I think this patch will fix it, could you please test it out?

diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index b3f6e03..50f3f8f 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -772,6 +772,10 @@ out:
 		 * If fib6_add_1 has cleared the old leaf pointer in the
 		 * super-tree leaf node we have to find a new one for it.
 		 */
+		if (pn != fn && pn->leaf == rt) {
+			pn->leaf = NULL;
+			atomic_dec(&rt->rt6i_ref);
+		}
 		if (pn != fn && !pn->leaf && !(pn->fn_flags & RTN_RTINFO)) {
 			pn->leaf = fib6_find_prefix(info->nl_net, pn);
 #if RT6_DEBUG >= 2



  parent reply	other threads:[~2008-04-18  8:32 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1207869029.19683.13.camel@localhost>
     [not found] ` <20080410.161453.52032573.davem@davemloft.net>
     [not found]   ` <1207870334.13150.11.camel@localhost>
2008-04-10 23:41     ` 2.6.25-rc8: FTP transfer errors David Miller
2008-04-10 23:51       ` vincent-perrier
2008-04-18  8:32       ` David Miller [this message]
2008-04-19  8:07         ` vincent-perrier
     [not found] <20080409.182228.193699767.davem@davemloft.net>
     [not found] ` <47FE3020.1070502@imap.cc>
     [not found]   ` <9a8748490804101509l5d043ff8w565dc44dfeaf0072@mail.gmail.com>
     [not found]     ` <20080410.154651.101700010.davem@davemloft.net>
2008-04-11  0:16       ` Mark Lord
2008-04-11  0:24         ` David Miller
2008-04-11  0:27           ` Mark Lord
2008-04-11  0:39             ` David Miller
2008-04-11  1:23               ` Mark Lord
2008-04-11  6:40                 ` Ilpo Järvinen
2008-04-11 13:19                   ` Mark Lord
2008-04-11 14:35                     ` Evgeniy Polyakov
2008-04-11 14:59                       ` Mark Lord
2008-04-11 15:18                         ` Evgeniy Polyakov
2008-04-11 18:07                           ` David Miller
2008-04-11 21:29                             ` Evgeniy Polyakov
2008-04-12  8:44                             ` Willy Tarreau
2008-04-12  9:49                               ` David Miller
2008-04-13 18:15                                 ` Rafael J. Wysocki
2008-04-13 18:51                                   ` Sergio Luis
2008-04-13 19:24                                     ` Rafael J. Wysocki
2008-04-11 19:58                         ` Valdis.Kletnieks
2008-04-11 22:16                       ` Tilman Schmidt
2008-04-11 22:25                         ` Evgeniy Polyakov
2008-04-11 22:27                           ` David Miller
2008-04-11 23:23                           ` Tilman Schmidt
2008-04-12  5:37                             ` Evgeniy Polyakov
2008-04-12  7:06                             ` Ilpo Järvinen
2008-04-11 22:26                         ` David Miller
2008-04-11 19:58                 ` Valdis.Kletnieks
2008-04-11 22:27                   ` Tilman Schmidt
2008-04-11  0:56           ` Tilman Schmidt
2008-04-11  1:08             ` David Miller
2008-04-11  0:26         ` David Miller
2008-04-11  0:29           ` Mark Lord
2008-04-11  2:59             ` YOSHIFUJI Hideaki / 吉藤英明
2008-04-11  7:50               ` Pavel Emelyanov
     [not found] <47FCF9DD.6080007@rtr.ca>
     [not found] ` <20080410.023045.16227424.yoshfuji@linux-ipv6.org>
     [not found]   ` <47FD138B.2060801@rtr.ca>
     [not found]     ` <20080409.152933.132174258.davem@davemloft.net>
     [not found]       ` <47FD590C.5020003@rtr.ca>
2008-04-10 20:46         ` Ilpo Järvinen
2008-04-10 21:05           ` Mark Lord
2008-04-10 21:43             ` Ilpo Järvinen

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=20080418.013228.155392171.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=vincent-perrier@club-internet.fr \
    --cc=yoshfuji@linux-ipv6.org \
    /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;
as well as URLs for NNTP newsgroup(s).