[ Upstream commit: Not applicable ]
The current rhashtable rehash code is buggy and can't deal with
parallel insertions/removals without corrupting the hash table.
This patch disables it by partially reverting
c5adde9468b0714a051eac7f9666f23eb10b61f7 ("netlink: eliminate
nl_sk_hash_lock").
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
struct netlink_table *table = &nl_table[sk->sk_protocol];
int err;
- lock_sock(sk);
+ mutex_lock(&table->hash.mutex);
err = -EBUSY;
if (nlk_sk(sk)->portid)
}
err:
- release_sock(sk);
+ mutex_unlock(&table->hash.mutex);
return err;
}
struct netlink_table *table;
table = &nl_table[sk->sk_protocol];
+ mutex_lock(&table->hash.mutex);
if (rhashtable_remove(&table->hash, &nlk_sk(sk)->node)) {
WARN_ON(atomic_read(&sk->sk_refcnt) == 1);
__sock_put(sk);
}
+ mutex_unlock(&table->hash.mutex);
netlink_table_grab();
if (nlk_sk(sk)->subscriptions) {