]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerDavid S. Miller <davem@davemloft.net>
Tue, 16 Oct 2018 05:33:27 +0000 (22:33 -0700)
commit04562c5e5b63a19f36f505b564ce7f7883e15f1d
tree9840478f060772c97d0379312224889e5953e94e
parentdfd3dee7c17a3f7231d4802aa7361066db2f1764
tipc: fix unsafe rcu locking when accessing publication list

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>
net/tipc/name_distr.c