From: Stephen Hemminger Date: Mon, 17 Jun 2013 21:16:11 +0000 (-0700) Subject: vxlan: fix race caused by dropping rtnl_unlock X-Git-Tag: v3.11-rc1~64^2~62^2~1^2~14 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c51a9159ddefa5119724a4c7da3fd3ef44b68d5;p=pandora-kernel.git vxlan: fix race caused by dropping rtnl_unlock It is possible for two cpu's to race creating vxlan device. For most cases this is harmless, but the ability to assign "next avaliable vxlan device" relies on rtnl lock being held across the whole operation. Therfore two instances of calling: ip li add vxlan%d vxlan ... could collide and create two devices with same name. To fix this defer creation of socket to a work queue, and handle possible races there. Introduce a lock to ensure that changes to vxlan socket hash list is SMP safe. Signed-off-by: Stephen Hemminger --- Reading git-diff-tree failed