From: Sowmini Varadhan Date: Sat, 25 Oct 2014 19:12:20 +0000 (-0400) Subject: sunvnet: Use RCU to synchronize port usage with vnet_port_remove() X-Git-Tag: omap-for-v3.19/fixes-rc1~125^2~347^2~1 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a968dd8f7d71ae85c4fe0ff190fbfb4212faf98;p=pandora-kernel.git sunvnet: Use RCU to synchronize port usage with vnet_port_remove() A vnet_port_remove could be triggered as a result of an ldm-unbind operation by the peer, module unload, or other changes to the inter-vnet-link configuration. When this is concurrent with vnet_start_xmit(), there are several race sequences possible, such as thread 1 thread 2 vnet_start_xmit -> tx_port_find spin_lock_irqsave(&vp->lock..) ret = __tx_port_find(..) spin_lock_irqrestore(&vp->lock..) vio_remove -> .. ->vnet_port_remove spin_lock_irqsave(&vp->lock..) cleanup spin_lock_irqrestore(&vp->lock..) kfree(port) /* attempt to use ret will bomb */ This patch adds RCU locking for port access so that vnet_port_remove will correctly clean up port-related state. Signed-off-by: Sowmini Varadhan Acked-by: Dwight Engen Acked-by: Bob Picco Signed-off-by: David S. Miller --- Reading git-diff-tree failed