lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 27 Oct 2020 21:53:43 -0400
From:   Willem de Bruijn <willemdebruijn.kernel@...il.com>
To:     Alexander Ovechkin <ovov@...dex-team.ru>
Cc:     Willem de Bruijn <willemdebruijn.kernel@...il.com>,
        vfedorenko@...ek.ru, Network Development <netdev@...r.kernel.org>,
        Tom Herbert <tom@...bertland.com>
Subject: Re: [PATCH net] ip6_tunnel: set inner ipproto before ip6_tnl_encap.

On Tue, Oct 27, 2020 at 5:52 PM Alexander Ovechkin <ovov@...dex-team.ru> wrote:
>
> > But it was moved on purpose to avoid setting the inner protocol to IPPROTO_MPLS. That needs to use skb->inner_protocol to further segment.
> And why do we need to avoid setting the inner protocol to IPPROTO_MPLS? Currently skb->inner_protocol is used before call of ip6_tnl_xmit.
> Can you please give example when this patch breaks MPLS segmentation?

mpls_gso_segment calls skb_mac_gso_segment on the inner packet. After
setting skb->protocol based on skb->inner_protocol.

perhaps mpls encap gso and udp tunnel gso simply cannot be enabled
together, because both use skb->inner_(ipproto|protocol) to demultiplex:

  18    163  net/ipv4/udp_offload.c <<skb_udp_tunnel_segment>>
             protocol = skb->inner_protocol;
  19     35  net/mpls/mpls_gso.c <<mpls_gso_segment>>
             skb->protocol = skb->inner_protocol;

   3    168  net/ipv4/udp_offload.c <<skb_udp_tunnel_segment>>
             ops = rcu_dereference(offloads[skb->inner_ipproto]);

Please don't top post, btw.


> > On 16 Oct 2020, at 20:55, Willem de Bruijn <willemdebruijn.kernel@...il.com> wrote:
> >
> > On Fri, Oct 16, 2020 at 7:14 AM Alexander Ovechkin <ovov@...dex-team.ru> wrote:
> >>
> >> ip6_tnl_encap assigns to proto transport protocol which
> >> encapsulates inner packet, but we must pass to set_inner_ipproto
> >> protocol of that inner packet.
> >>
> >> Calling set_inner_ipproto after ip6_tnl_encap might break gso.
> >> For example, in case of encapsulating ipv6 packet in fou6 packet, inner_ipproto
> >> would be set to IPPROTO_UDP instead of IPPROTO_IPV6. This would lead to
> >> incorrect calling sequence of gso functions:
> >> ipv6_gso_segment -> udp6_ufo_fragment -> skb_udp_tunnel_segment -> udp6_ufo_fragment
> >> instead of:
> >> ipv6_gso_segment -> udp6_ufo_fragment -> skb_udp_tunnel_segment -> ip6ip6_gso_segment
> >>
> >> Signed-off-by: Alexander Ovechkin <ovov@...dex-team.ru>
> >
> > Commit 6c11fbf97e69 ("ip6_tunnel: add MPLS transmit support") moved
> > the call from ip6_tnl_encap's caller to inside ip6_tnl_encap.
> >
> > It makes sense that that likely broke this behavior for UDP (L4) tunnels.
> >
> > But it was moved on purpose to avoid setting the inner protocol to
> > IPPROTO_MPLS. That needs to use skb->inner_protocol to further
> > segment.
> >
> > I suspect we need to set this before or after conditionally to avoid
> > breaking that use case.
>

Powered by blists - more mailing lists