]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: Fix tipc_sk_reinit race conditions
authorHerbert Xu <herbert@gondor.apana.org.au>
Sat, 11 Feb 2017 11:26:46 +0000 (19:26 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 14 Feb 2017 03:17:05 +0000 (22:17 -0500)
commite6ee32b8c0d8ec3edb73d96484ae73a62dafbdcb
treee5a2f465754351a263da6bdcc8816bbb051f2f76
parentaa8b226eef1e311917bcf7b3b1a658aa5f44ddd3
tipc: Fix tipc_sk_reinit race conditions

There are two problems with the function tipc_sk_reinit.  Firstly
it's doing a manual walk over an rhashtable.  This is broken as
an rhashtable can be resized and if you manually walk over it
during a resize then you may miss entries.

Secondly it's missing memory barriers as previously the code used
spinlocks which provide the barriers implicitly.

This patch fixes both problems.

Fixes: fe5d2a555b38 ("tipc: convert tipc reference table to...")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/net.c
net/tipc/socket.c