netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: michel@digirati.com.br, netdev@vger.kernel.org
Subject: Re: [PATCH 1/1] neighbour: Fixed race condition at tbl->nht
Date: Tue, 21 Feb 2012 16:29:05 -0500 (EST)	[thread overview]
Message-ID: <20120221.162905.83071433719723123.davem@davemloft.net> (raw)
In-Reply-To: <1329859522.18384.57.camel@edumazet-laptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 21 Feb 2012 22:25:22 +0100

> Le mardi 21 février 2012 à 16:04 -0500, Michel Machado a écrit :
>> When the fixed race condition happens:
>> 
>> 1. While function neigh_periodic_work scans the neighbor hash table
>> pointed by field tbl->nht, it unlocks and locks tbl->lock between
>> buckets in order to call cond_resched.
>> 
>> 2. Assume that function neigh_periodic_work calls cond_resched, that is,
>> the lock tbl->lock is available, and function neigh_hash_grow runs.
>> 
>> 3. Once function neigh_hash_grow finishes, and RCU calls
>> neigh_hash_free_rcu, the original struct neigh_hash_table that function
>> neigh_periodic_work was using doesn't exist anymore.
>> 
>> 4. Once back at neigh_periodic_work, whenever the old struct
>> neigh_hash_table is accessed, things can go badly.
>> 
>> Signed-off-by: Michel Machado <michel@digirati.com.br>
 ...
> Nice catch !
> 
> Bug introduced in 2.6.37 in commit d6bf781712a (net neigh: RCU
> conversion of neigh hash table)
> 
> Acked-by: Eric Dumazet <eric.dumazet@gmail.com>

Applied, and queued up for -stable, thanks.

      reply	other threads:[~2012-02-21 21:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-21 21:04 [PATCH 1/1] neighbour: Fixed race condition at tbl->nht Michel Machado
2012-02-21 21:25 ` Eric Dumazet
2012-02-21 21:29   ` David 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=20120221.162905.83071433719723123.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=michel@digirati.com.br \
    --cc=netdev@vger.kernel.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).