]> www.infradead.org Git - users/jedix/linux-maple.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)
committerChuck Anderson <chuck.anderson@oracle.com>
Fri, 5 Feb 2016 03:33:32 +0000 (19:33 -0800)
commit315e5b58922a1de71b288f9c7feef7aa45eb938e
tree811ebb4ab5ebcd056001904f5f9b09fba68cbe8f
parent9774ab714449f141fb4984c7eb5e90951aca0750
rhashtable: Fix walker list corruption

Orabug: 22623889

[ Upstream commit c6ff5268293ef98e48a99597e765ffc417e39fa5 ]

The commit ba7c95ea3870fe7b847466d39a049ab6f156aa2c ("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: ba7c95ea3870 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit ac5966d165a9b4115744269a64ffd3d061b5efe2)
Signed-off-by: Dan Duval <dan.duval@oracle.com>
lib/rhashtable.c