LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: kyle@moffetthome.net (Kyle Moffett)
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	davem@davemloft.net
Subject: Re: [NET/IPv6] Race condition with flow_cache_genid?
Date: Sat, 09 Feb 2008 05:16:14 +1100	[thread overview]
Message-ID: <E1JNXlm-0004pM-00@gondolin.me.apana.org.au> (raw)
In-Reply-To: <f73f7ab80802061036u64a56abnccafacf68f2ed717@mail.gmail.com>

Kyle Moffett <kyle@moffetthome.net> wrote:
>
> Basically either there is some missing locking here or it does not
> need to be "atomic_t".  Judging from the way it *appears* to be used
> to check if cache entries are up-to-date with the latest changes in
> policy, I would guess the former.

You're right that it doesn't really have to be an atomic since
all the writers are from xfrm currently.  However, the fact that
it is atomic is used by the current code since sometimes they
increment the value without holding the xfrm policy lock.

Yes it is racy but that is fine for the purpose that this variable
serves.  All it does is to make sure that extant flow objects get
killed at some point after the increment.  There is absolutely no
requirement that the killing be immediate or synchronised.

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

      reply	other threads:[~2008-02-08 18:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-03  5:28 Kyle Moffett
2008-02-06  4:02 ` David Miller
2008-02-06 18:36 ` Kyle Moffett
2008-02-08 18:16   ` Herbert Xu [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=E1JNXlm-0004pM-00@gondolin.me.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=davem@davemloft.net \
    --cc=kyle@moffetthome.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --subject='Re: [NET/IPv6] Race condition with flow_cache_genid?' \
    /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

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).