]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
xfrm interface: fix list corruption for x-netns
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Mon, 15 Jul 2019 10:00:22 +0000 (12:00 +0200)
committerSteffen Klassert <steffen.klassert@secunet.com>
Wed, 17 Jul 2019 08:03:54 +0000 (10:03 +0200)
commitc5d1030f23002430c2a336b2b629b9d6f72b3564
tree18ae6bb8642ab4a1931cbeb52ea741f9955244f5
parente0aaa332e6a97dae57ad59cdb19e21f83c3d081c
xfrm interface: fix list corruption for x-netns

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: f203b76d7809 ("xfrm: Add virtual xfrm interfaces")
Reported-by: Julien Floret <julien.floret@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Tested-by: Julien Floret <julien.floret@6wind.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_interface.c