xfrm interface: fix list corruption for x-netns
commit c5d1030f23002430c2a336b2b629b9d6f72b3564 upstream. dev_net(dev) is the netns of the device and xi->net is the link netns, where the device has been linked. changelink() must operate in the link netns to avoid a corruption of the xfrm lists. Note that xi->net and dev_net(xi->physdev) are always the same. Before the patch, the xfrmi lists may be corrupted and can later trigger a kernel panic. Fixes: f203b76d ("xfrm: Add virtual xfrm interfaces") Reported-by: NJulien Floret <julien.floret@6wind.com> Signed-off-by: NNicolas Dichtel <nicolas.dichtel@6wind.com> Tested-by: NJulien Floret <julien.floret@6wind.com> Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Showing
想要评论请 注册 或 登录