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  linux-cve-announce  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, 12 Jul 2022 15:14:50 -0700
From:   sdf@...gle.com
To:     Andrea Mayer <andrea.mayer@...roma2.it>
Cc:     "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
        David Ahern <dsahern@...nel.org>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Andrii Nakryiko <andrii@...nel.org>,
        Martin KaFai Lau <kafai@...com>,
        Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
        John Fastabend <john.fastabend@...il.com>,
        KP Singh <kpsingh@...nel.org>,
        David Lebrun <david.lebrun@...ouvain.be>,
        Mathieu Xhonneux <m.xhonneux@...il.com>,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        bpf@...r.kernel.org, Stefano Salsano <stefano.salsano@...roma2.it>,
        Paolo Lungaroni <paolo.lungaroni@...roma2.it>,
        Ahmed Abdelsalam <ahabdels.dev@...il.com>,
        Anton Makarov <anton.makarov11235@...il.com>
Subject: Re: [net 0/3] seg6: fix skb checksum for SRH encapsulation/insertion

On 07/12, Andrea Mayer wrote:
> The Linux kernel supports Segment Routing Header (SRH)
> encapsulation/insertion operations by providing the capability to: i)
> encapsulate a packet in an outer IPv6 header with a specified SRH; ii)
> insert a specified SRH directly after the IPv6 header of the packet.
> Note that the insertion operation is also referred to as 'injection'.

> The two operations are respectively supported by seg6_do_srh_encap() and
> seg6_do_srh_inline(), which operate on the skb associated to the packet as
> needed (e.g. adding the necessary headers and initializing them, while
> taking care to recalculate the skb checksum).

> seg6_do_srh_encap() and seg6_do_srh_inline() do not initialize the payload
> length of the IPv6 header, which is carried out by the caller functions.
> However, this approach causes the corruption of the skb checksum which
> needs to be updated only after initialization of headers is completed
> (thanks to Paolo Abeni for detecting this issue).

> The patchset fixes the skb checksum corruption by moving the IPv6 header
> payload length initialization from the callers of seg6_do_srh_encap() and
> seg6_do_srh_inline() directly into these functions.

> This patchset is organized as follows:
>   - patch 1/3, seg6: fix skb checksum evaluation in SRH
>     encapsulation/insertion;
>      (* SRH encapsulation/insertion available since v4.10)

>   - patch 2/3, seg6: fix skb checksum in SRv6 End.B6 and End.B6.Encaps
>     behaviors;
>      (* SRv6 End.B6 and End.B6.Encaps behaviors available since v4.14)

>   - patch 3/3, seg6: bpf: fix skb checksum in bpf_push_seg6_encap();
>      (* bpf IPv6 Segment Routing helpers available since v4.18)

BPF changes make sense. I've tested them by applying the whole series and
running test_lwt_seg6local.sh.

Reviewed-by: Stanislav Fomichev <sdf@...gle.com>
Tested-by: Stanislav Fomichev <sdf@...gle.com>


> Thank you all,
> Andrea

> Andrea Mayer (3):
>    seg6: fix skb checksum evaluation in SRH encapsulation/insertion
>    seg6: fix skb checksum in SRv6 End.B6 and End.B6.Encaps behaviors
>    seg6: bpf: fix skb checksum in bpf_push_seg6_encap()

>   net/core/filter.c        | 1 -
>   net/ipv6/seg6_iptunnel.c | 5 ++++-
>   net/ipv6/seg6_local.c    | 2 --
>   3 files changed, 4 insertions(+), 4 deletions(-)

> --
> 2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ