]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
tipc: fix premature addition of node to lookup table
authorJon Paul Maloy <jon.maloy@ericsson.com>
Wed, 10 Feb 2016 21:14:57 +0000 (16:14 -0500)
committerDavid S. Miller <davem@davemloft.net>
Tue, 16 Feb 2016 20:57:11 +0000 (15:57 -0500)
commitd5c91fb72f1652ea3026925240a0998a42ddb16b
tree8e731cefe0bc105ddede8e43ff947fe9903a8ee3
parent7facc5fbde878b2441962748823966bf2ec1d446
tipc: fix premature addition of node to lookup table

In commit 5266698661401a ("tipc: let broadcast packet reception
use new link receive function") we introduced a new per-node
broadcast reception link instance. This link is created at the
moment the node itself is created. Unfortunately, the allocation
is done after the node instance has already been added to the node
lookup hash table. This creates a potential race condition, where
arriving broadcast packets are able to find and access the node
before it has been fully initialized, and before the above mentioned
link has been created. The result is occasional crashes in the function
tipc_bcast_rcv(), which is trying to access the not-yet existing link.

We fix this by deferring the addition of the node instance until after
it has been fully initialized in the function tipc_node_create().

Acked-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/node.c