tipc: fix unsafe rcu locking when accessing publication list
authorTung Nguyen <tung.q.nguyen@dektech.com.au>
Fri, 12 Oct 2018 20:46:55 +0000 (22:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 4 Nov 2018 13:51:53 +0000 (14:51 +0100)
commitb3c2e8e106df1d271fb7f4e3d3def7f13a47ac74
treea3140e7050ee2b9f75b52b4f0729ff5825ec5597
parent721933262ef72a24595598ad6d20e98fc1b1ab82
tipc: fix unsafe rcu locking when accessing publication list

[ Upstream commit d3092b2efca1cd1d492d0b08499a2066c5ca8cec ]

The binding table's 'cluster_scope' list is rcu protected to handle
races between threads changing the list and those traversing the list at
the same moment. We have now found that the function named_distribute()
uses the regular list_for_each() macro to traverse the said list.
Likewise, the function tipc_named_withdraw() is removing items from the
same list using the regular list_del() call. When these two functions
execute in parallel we see occasional crashes.

This commit fixes this by adding the missing _rcu() suffixes.

Signed-off-by: Tung Nguyen <tung.q.nguyen@dektech.com.au>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/tipc/name_distr.c