Commit 77d883e7 authored by Tobias Brunner's avatar Tobias Brunner Committed by Xie XiuQi
Browse files

xfrm: Fix inbound traffic via XFRM interfaces across network namespaces



mainline inclusion
from mainline-5.0
commit 660899dd
category: bugfix
bugzilla: 10928
CVE: NA

-------------------------------------------------

After moving an XFRM interface to another namespace it stays associated
with the original namespace (net in `struct xfrm_if` and the list keyed
with `xfrmi_net_id`), allowing processes in the new namespace to use
SAs/policies that were created in the original namespace.  For instance,
this allows a keying daemon in one namespace to establish IPsec SAs for
other namespaces without processes there having access to the keys or IKE
credentials.

This worked fine for outbound traffic, however, for inbound traffic the
lookup for the interfaces and the policies used the incorrect namespace
(the one the XFRM interface was moved to).

Fixes: f203b76d ("xfrm: Add virtual xfrm interfaces")
Signed-off-by: default avatarTobias Brunner <tobias@strongswan.org>
Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: default avatarZhiqiang Liu <liuzhiqiang26@huawei.com>
Reviewed-by: default avatarWenan Mao <maowenan@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent d985029e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment