From: Herbert Xu <herbert@gondor.apana.org.au>
To: Jiri Bohac <jbohac@suse.cz>
Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
netdev@vger.kernel.org, David Miller <davem@davemloft.net>,
Stephen Hemminger <shemminger@vyatta.com>
Subject: Re: IPv6: race condition in __ipv6_ifa_notify() and dst_free() ?
Date: Thu, 22 Apr 2010 10:32:11 +0800 [thread overview]
Message-ID: <20100422023211.GA7109@gondor.apana.org.au> (raw)
In-Reply-To: <20100421213429.GA2799@midget.suse.cz>
On Wed, Apr 21, 2010 at 11:34:29PM +0200, Jiri Bohac wrote:
> Hi,
>
> On Tue, Apr 20, 2010 at 07:44:01PM +0200, Jiri Bohac wrote:
> > What is the reason __ipv6_ifa_notify() calls dst_free() when
> > ip6_del_rt() fails? I don't see a way ip6_del_rt() could fail
> > with the dst still needing to be freed.
>
> checked again and I still think that if ip6_del_rt() fails,
> ifp->rt must have been freed already. Anybody with a
> counterexample?
I agree with your diagnosis and the two duplicate NDISC messages
scenario sounds plausible.
Anyway, I think the root of the issue is the fact that NDISC is
calling addrconf_dad_failure with no locking whatsoever. The
latter is not idempotent so some form of locking is needed.
This bug appears to have been around since the very start.
I'll dig deeper to see where we might be able to add some locks.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
next prev parent reply other threads:[~2010-04-22 2:32 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-20 17:44 IPv6: race condition in __ipv6_ifa_notify() and dst_free() ? Jiri Bohac
2010-04-20 17:57 ` Eric Dumazet
2010-04-20 20:49 ` Jiri Bohac
2010-04-20 20:57 ` Eric Dumazet
2010-04-20 21:16 ` Stephen Hemminger
2010-04-20 21:35 ` Jiri Bohac
2010-04-21 21:34 ` Jiri Bohac
2010-04-22 2:32 ` Herbert Xu [this message]
2010-04-22 7:43 ` David Miller
2010-04-22 14:25 ` Herbert Xu
2010-04-22 15:49 ` Jiri Bohac
2010-04-22 16:17 ` Stephen Hemminger
2010-04-23 1:54 ` David Miller
2010-04-23 2:10 ` Herbert Xu
2010-04-23 15:05 ` Herbert Xu
2010-05-18 11:02 ` [0/4] Fix addrconf race conditions Herbert Xu
2010-05-18 11:04 ` [PATCH 1/4] ipv6: Replace inet6_ifaddr->dead with state Herbert Xu
2010-05-18 17:23 ` Stephen Hemminger
2010-05-18 22:27 ` David Miller
2010-05-18 11:04 ` [PATCH 2/4] ipv6: Use state_lock to protect ifa state Herbert Xu
2010-05-18 11:04 ` [PATCH 3/4] ipv6: Use POSTDAD state Herbert Xu
2010-05-18 11:04 ` [PATCH 4/4] ipv6: Never schedule DAD timer on dead address Herbert Xu
2010-05-18 17:25 ` [0/4] Fix addrconf race conditions Stephen Hemminger
2010-05-18 22:27 ` David Miller
2010-05-18 22:35 ` Herbert Xu
2010-04-27 15:50 ` IPv6: race condition in __ipv6_ifa_notify() and dst_free() ? Jiri Bohac
2010-04-27 15:55 ` Herbert Xu
2010-05-09 6:48 ` Herbert Xu
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=20100422023211.GA7109@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=davem@davemloft.net \
--cc=jbohac@suse.cz \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.com \
--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).