Netdev List
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@davemloft.net>
To: yoshfuji@linux-ipv6.org
Cc: netdev@vger.kernel.org
Subject: Re: [RFC PATCH] [IPV6]: Fix race in route selection.
Date: Fri, 28 Apr 2006 15:58:27 -0700 (PDT)	[thread overview]
Message-ID: <20060428.155827.04891779.davem@davemloft.net> (raw)
In-Reply-To: <20060428.020456.35552581.yoshfuji@linux-ipv6.org>

From: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Date: Fri, 28 Apr 2006 02:04:56 +0900 (JST)

> We eliminated rt6_dflt_lock (to protect default router pointer)
> at 2.6.17-rc1, and introduced rt6_select() for general router selection.
> The function is called in the context of rt6_lock read-lock held,
> but this means, we have some race conditions when we do round-robin.
> 
> Am I correct?
> 
> If so, we should put some spin_lock for serialization.
> 
> Comments?
> 
> Signed-off-by; YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
> 
> Or, should we run whole part of rt6_select() under some lock?

I think the local lock will work and it is fine for now.
I will apply this as-is to fix the bug.

But in the longer term this seems a little bit heavy operation.
Perhaps there is some way to use "xchg()" here?  It is just moving a
pointer around for a round robin list, if it could be reduced to just
a single pointer store, we could even do it without atomic operations.


      reply	other threads:[~2006-04-28 22:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-27 17:04 [RFC PATCH] [IPV6]: Fix race in route selection YOSHIFUJI Hideaki / 吉藤英明
2006-04-28 22:58 ` David S. Miller [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=20060428.155827.04891779.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --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