From: Thomas Zeitlhofer <hidden> Date: 2016-09-04 11:13:07
In case of inter address family tunneling (IPv6 over vti4 or IPv4 over
vti6), the inbound policy checks in vti_rcv_cb and vti6_rcv_cb are using
the wrong address family. As a result, all inbound inter address family
traffic is dropped.
Use the xfrm_ip2inner_mode helper (as done in xfrm_prepare_input and
xfrm_input) to select the inner_mode that contains the right address family
for the inbound policy checks.
Signed-off-by: Thomas Zeitlhofer <redacted>
---
Notes:
The patch was developed by looking at the code, but without knowledge of
the XFRM code in the kernel. It has been successfully tested, but it is
more a guess that might be helpful for the maintainers to find a proper
solution.
net/ipv4/ip_vti.c | 12 +++++++++++-
net/ipv6/ip6_vti.c | 12 +++++++++++-
2 files changed, 22 insertions(+), 2 deletions(-)
On Sun, Sep 04, 2016 at 12:57:13PM +0200, Thomas Zeitlhofer wrote:
quoted hunk
In case of inter address family tunneling (IPv6 over vti4 or IPv4 over
vti6), the inbound policy checks in vti_rcv_cb and vti6_rcv_cb are using
the wrong address family. As a result, all inbound inter address family
traffic is dropped.
Use the xfrm_ip2inner_mode helper (as done in xfrm_prepare_input and
xfrm_input) to select the inner_mode that contains the right address family
for the inbound policy checks.
Signed-off-by: Thomas Zeitlhofer <redacted>
---
Notes:
The patch was developed by looking at the code, but without knowledge of
the XFRM code in the kernel. It has been successfully tested, but it is
more a guess that might be helpful for the maintainers to find a proper
solution.
net/ipv4/ip_vti.c | 12 +++++++++++-
net/ipv6/ip6_vti.c | 12 +++++++++++-
2 files changed, 22 insertions(+), 2 deletions(-)
In case of inter address family tunneling (IPv6 over vti4 or IPv4 over
vti6), the inbound policy checks in vti_rcv_cb() and vti6_rcv_cb() are
using the wrong address family. As a result, all inbound inter address
family traffic is dropped.
Use the xfrm_ip2inner_mode() helper, as done in xfrm_input() (i.e., also
increment LINUX_MIB_XFRMINSTATEMODEERROR in case of error), to select the
inner_mode that contains the right address family for the inbound policy
checks.
Signed-off-by: Thomas Zeitlhofer <redacted>
---
Notes:
v2: implement review comments from Steffen (thanks for the reply):
- return -EINVAL in case of error
- increment LINUX_MIB_XFRMINSTATEMODEERROR in case of error
Just to point that out, in case there are arguments against it:
this is done in the namespace of skb->dev and not in the
t(unnel)?->net namespace.
and update the commit message accordingly.
net/ipv4/ip_vti.c | 15 ++++++++++++++-
net/ipv6/ip6_vti.c | 15 ++++++++++++++-
2 files changed, 28 insertions(+), 2 deletions(-)
In case of inter address family tunneling (IPv6 over vti4 or IPv4 over
vti6), the inbound policy checks in vti_rcv_cb() and vti6_rcv_cb() are
using the wrong address family. As a result, all inbound inter address
family traffic is dropped.
Use the xfrm_ip2inner_mode() helper, as done in xfrm_input() (i.e., also
increment LINUX_MIB_XFRMINSTATEMODEERROR in case of error), to select the
inner_mode that contains the right address family for the inbound policy
checks.
Signed-off-by: Thomas Zeitlhofer <redacted>
Steffen please review this new version of the patch.
Thanks.
On Wed, Sep 07, 2016 at 08:40:38PM +0200, thomas.zeitlhofer+lkml@ze-it.at wrote:
In case of inter address family tunneling (IPv6 over vti4 or IPv4 over
vti6), the inbound policy checks in vti_rcv_cb() and vti6_rcv_cb() are
using the wrong address family. As a result, all inbound inter address
family traffic is dropped.
Use the xfrm_ip2inner_mode() helper, as done in xfrm_input() (i.e., also
increment LINUX_MIB_XFRMINSTATEMODEERROR in case of error), to select the
inner_mode that contains the right address family for the inbound policy
checks.
Signed-off-by: Thomas Zeitlhofer <redacted>
---
Notes:
v2: implement review comments from Steffen (thanks for the reply):
- return -EINVAL in case of error
- increment LINUX_MIB_XFRMINSTATEMODEERROR in case of error
Just to point that out, in case there are arguments against it:
this is done in the namespace of skb->dev and not in the
t(unnel)?->net namespace.
This is ok because the states are configured in that namespace.
I've applied this to the ipsec tree, thanks a lot!