]> git.baikalelectronics.ru Git - kernel.git/commit
rhashtable: Fix sleeping inside RCU critical section in walk_stop
authorHerbert Xu <herbert@gondor.apana.org.au>
Mon, 23 Mar 2015 22:53:17 +0000 (09:53 +1100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Mar 2015 02:16:07 +0000 (22:16 -0400)
commitf7ec0e2f78dcfad7c0716b3ac2482fd4164a5223
tree8fed9deb6a4a0c1f52634ff0bd07fb6a0edb8dde
parentab42f12b04c1f263937236e8bdb596ed81d0b338
rhashtable: Fix sleeping inside RCU critical section in walk_stop

The commit 0062d19dc7de879c3c1033f6ea970a6f8e8e8a1f ("rhashtable:
Fix use-after-free in rhashtable_walk_stop") fixed a real bug
but created another one because we may end up sleeping inside an
RCU critical section.

This patch fixes it properly by replacing the mutex with a spin
lock that specifically protects the walker lists.

Reported-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/rhashtable.h
lib/rhashtable.c