]> git.baikalelectronics.ru Git - kernel.git/commit
rhashtable: Fix walker list corruption
authorHerbert Xu <herbert@gondor.apana.org.au>
Wed, 16 Dec 2015 08:45:54 +0000 (16:45 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 Dec 2015 16:13:14 +0000 (11:13 -0500)
commit2016255d32422088a09dab34253a588eb1d32235
tree383abd638c072a92aab2e874870607b1147b8797
parentebbd4dd1cf34e2310ad14382bd1b11b167218a32
rhashtable: Fix walker list corruption

The commit f7ec0e2f78dcfad7c0716b3ac2482fd4164a5223 ("rhashtable:
Fix sleeping inside RCU critical section in walk_stop") introduced
a new spinlock for the walker list.  However, it did not convert
all existing users of the list over to the new spin lock.  Some
continued to use the old mutext for this purpose.  This obviously
led to corruption of the list.

The fix is to use the spin lock everywhere where we touch the list.

This also allows us to do rcu_rad_lock before we take the lock in
rhashtable_walk_start.  With the old mutex this would've deadlocked
but it's safe with the new spin lock.

Fixes: f7ec0e2f78dc ("rhashtable: Fix sleeping inside RCU...")
Reported-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
lib/rhashtable.c