[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20120221.162905.83071433719723123.davem@davemloft.net>
Date: Tue, 21 Feb 2012 16:29:05 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: eric.dumazet@...il.com
Cc: michel@...irati.com.br, netdev@...r.kernel.org
Subject: Re: [PATCH 1/1] neighbour: Fixed race condition at tbl->nht
From: Eric Dumazet <eric.dumazet@...il.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@...irati.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@...il.com>
Applied, and queued up for -stable, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists