mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "YOSHIFUJI Hideaki / 吉藤英明" <yoshfuji@linux-ipv6.org>
To: herbert@gondor.apana.org.au
Cc: davem@davemloft.net, mirko.parthey@informatik.tu-chemnitz.de,
	linux-kernel@vger.kernel.org, netdev@oss.sgi.com,
	shemminger@osdl.org, yoshfuji@linux-ipv6.org
Subject: Re: PROBLEM: 2.6.11-rc2 hangs on bridge shutdown (br0)
Date: Sun, 06 Feb 2005 21:30:18 +0900 (JST)	[thread overview]
Message-ID: <20050206.213018.92031627.yoshfuji@linux-ipv6.org> (raw)
In-Reply-To: <20050206114145.GA20883@gondor.apana.org.au>

In article <20050206114145.GA20883@gondor.apana.org.au> (at Sun, 6 Feb 2005 22:41:45 +1100), Herbert Xu <herbert@gondor.apana.org.au> says:

> On Sat, Feb 05, 2005 at 09:45:59PM +1100, herbert wrote:
> > 
> > Although I still think this is a bug, I'm now starting to suspect
> > that there is another bug around as well.
> > 
> > There is probably an ifp leak which in turn leads to a split dst
> > leak that allows the first bug to make its mark.
> 
> Found it.  This is what happens:
> 
> lo goes down =>
> 	rt6_ifdown =>
> 		eth0's local address route gets deleted
> 
> eth0 goes down =>
> 	__ipv6_ifa_notify =>
> 		ip6_del_rt fails so we fall through to the
> 		dst_free path.  At this point the refcount
> 		taken by __ipv6_ifa_notify is leaked.

Oh, you're right! Thanks.

How about this; Ignore entries addrconf_dst_alloc'ed entries in rt6_ifdown()?

Signed-off-by: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>

===== include/linux/ipv6_route.h 1.6 vs edited =====
--- 1.6/include/linux/ipv6_route.h	2004-10-26 12:54:23 +09:00
+++ edited/include/linux/ipv6_route.h	2005-02-06 21:27:02 +09:00
@@ -26,6 +26,7 @@
 #define RTF_FLOW	0x02000000	/* flow significant route	*/
 #define RTF_POLICY	0x04000000	/* policy route			*/
 
+#define RTF_ANYCAST	0x40000000
 #define RTF_LOCAL	0x80000000
 
 struct in6_rtmsg {
===== net/ipv6/route.c 1.105 vs edited =====
--- 1.105/net/ipv6/route.c	2005-01-15 17:44:48 +09:00
+++ edited/net/ipv6/route.c	2005-02-06 21:26:35 +09:00
@@ -1408,7 +1408,9 @@
 	rt->u.dst.obsolete = -1;
 
 	rt->rt6i_flags = RTF_UP | RTF_NONEXTHOP;
-	if (!anycast)
+	if (anycast)
+		rt->rt6i_flags |= RTF_ANYCAST;
+	else
 		rt->rt6i_flags |= RTF_LOCAL;
 	rt->rt6i_nexthop = ndisc_get_neigh(rt->rt6i_dev, &rt->rt6i_gateway);
 	if (rt->rt6i_nexthop == NULL) {
@@ -1427,7 +1429,8 @@
 static int fib6_ifdown(struct rt6_info *rt, void *arg)
 {
 	if (((void*)rt->rt6i_dev == arg || arg == NULL) &&
-	    rt != &ip6_null_entry) {
+	    rt != &ip6_null_entry &&
+	    !(rt->rt6i_flags & (RTF_LOCAL|RTF_ANYCAST))) {
 		RT6_TRACE("deleted by ifdown %p\n", rt);
 		return -1;
 	}

-- 
Hideaki YOSHIFUJI @ USAGI Project <yoshfuji@linux-ipv6.org>
GPG FP: 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA

  reply	other threads:[~2005-02-06 12:29 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-31 16:22 Mirko Parthey
2005-01-31 17:40 ` Matthias-Christian Ott
2005-02-01 17:36 ` Mirko Parthey
2005-02-02 16:08   ` Matthias-Christian Ott
2005-02-05 12:48     ` Matthias-Christian Ott
2005-02-05  5:24 ` Herbert Xu
2005-02-05  5:38   ` David S. Miller
2005-02-05  6:11     ` Herbert Xu
2005-02-05  6:13       ` David S. Miller
2005-02-05  6:46         ` Herbert Xu
2005-02-05 10:45           ` Herbert Xu
2005-02-06 11:41             ` Herbert Xu
2005-02-06 12:30               ` YOSHIFUJI Hideaki / 吉藤英明 [this message]
2005-02-06 21:01                 ` Herbert Xu
2005-02-05 10:50           ` YOSHIFUJI Hideaki / 吉藤英明
2005-02-05 18:32             ` Herbert Xu
2005-02-06  4:02             ` David S. Miller
2005-02-06  5:01               ` YOSHIFUJI Hideaki / 吉藤英明
2005-02-06  4:10           ` David S. Miller
2005-02-06  4:37             ` YOSHIFUJI Hideaki / 吉藤英明
2005-02-06  5:04               ` David S. Miller
2005-02-06  5:31                 ` YOSHIFUJI Hideaki / 吉藤英明
2005-02-06  5:50                   ` YOSHIFUJI Hideaki / 吉藤英明
2005-02-06  7:00                     ` Herbert Xu
2005-02-06  6:53                   ` Herbert Xu
2005-02-06  6:52                 ` Herbert Xu
2005-02-06  6:51             ` Herbert Xu
2005-02-08  1:29               ` [IPSEC] Move dst->child loop from dst_ifdown to xfrm_dst_ifdown Herbert Xu
2005-02-08  1:31                 ` Herbert Xu
2005-02-15 22:53                   ` David S. Miller
2005-02-05 11:14       ` PROBLEM: 2.6.11-rc2 hangs on bridge shutdown (br0) Andre Tomt
2005-02-05 11:39         ` YOSHIFUJI Hideaki / 吉藤英明
     [not found]           ` <4204B27F.5040202@tomt.net>
2005-02-05 11:55             ` YOSHIFUJI Hideaki / 吉藤英明
2005-02-05 18:33           ` Herbert Xu
2005-02-06 10:55       ` Andre Tomt
2005-02-06 11:28         ` YOSHIFUJI Hideaki / 吉藤英明

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=20050206.213018.92031627.yoshfuji@linux-ipv6.org \
    --to=yoshfuji@linux-ipv6.org \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mirko.parthey@informatik.tu-chemnitz.de \
    --cc=netdev@oss.sgi.com \
    --cc=shemminger@osdl.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

all inboxes | Powered by JetHome®