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:   Wed, 11 Nov 2020 15:12:21 +0100
From:   Santucci Pierpaolo <santucci@...genesys.com>
To:     Jakub Sitnicki <jakub@...udflare.com>
Cc:     Andrii Nakryiko <andrii.nakryiko@...il.com>,
        Shuah Khan <shuah@...nel.org>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Martin Lau <kafai@...com>, Song Liu <songliubraving@...com>,
        Yonghong Song <yhs@...com>,
        Andrii Nakryiko <andrii@...nel.org>,
        john fastabend <john.fastabend@...il.com>,
        KP Singh <kpsingh@...omium.org>,
        Networking <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>
Subject: Re: [PATCH] selftest/bpf: fix IPV6FR handling in flow dissector

Hi Jakub,

thanks for your reply.

Let me explain the problem with an example.

Please consider the PCAP file:
https://github.com/named-data/ndn-tools/blob/master/tests/dissect-wireshark/ipv6-udp-fragmented.pcap
Let's assume that the dissector is invoked without the flag:
BPF_FLOW_DISSECTOR_F_STOP_AT_FLOW_LABEL.
 
Without the proposed patch, the flow keys for the second fragment (packet
timestamp 0.256997) will contain the value 0x6868 for the source and
destination port fields: this is obviously wrong.
The same happens for the third fragment (packet timestamp 0.256998) and for
the fourth fragment (packet timestamp 0.257001).

So it seems that the correct thing to do is to stop the dissector after the
IPV6 fragmentation header for all fragments from the second on.

Regards,
    Pierpaolo Santucci

On Wed, Nov 11, 2020 at 12:17:06PM +0100, Jakub Sitnicki wrote:
> On Wed, Nov 11, 2020 at 05:48 AM CET, Andrii Nakryiko wrote:
> > On Tue, Nov 10, 2020 at 9:12 AM Santucci Pierpaolo
> > <santucci@...genesys.com> wrote:
> >>
> >> From second fragment on, IPV6FR program must stop the dissection of IPV6
> >> fragmented packet. This is the same approach used for IPV4 fragmentation.
> >>
> >
> > Jakub, can you please take a look as well?
> 
> I'm not initimately familiar with this test, but looking at the change
> I'd consider that Destinations Options and encapsulation headers can
> follow the Fragment Header.
> 
> With enough of Dst Opts or levels of encapsulation, transport header
> could be pushed to the 2nd fragment. So I'm not sure if the assertion
> from the IPv4 dissector that 2nd fragment and following doesn't contain
> any parseable header holds.
> 
> Taking a step back... what problem are we fixing here?
> 
> >
> >> Signed-off-by: Santucci Pierpaolo <santucci@...genesys.com>
> >> ---
> >>  tools/testing/selftests/bpf/progs/bpf_flow.c | 2 ++
> >>  1 file changed, 2 insertions(+)
> >>
> >> diff --git a/tools/testing/selftests/bpf/progs/bpf_flow.c b/tools/testing/selftests/bpf/progs/bpf_flow.c
> >> index 5a65f6b51377..95a5a0778ed7 100644
> >> --- a/tools/testing/selftests/bpf/progs/bpf_flow.c
> >> +++ b/tools/testing/selftests/bpf/progs/bpf_flow.c
> >> @@ -368,6 +368,8 @@ PROG(IPV6FR)(struct __sk_buff *skb)
> >>                  */
> >>                 if (!(keys->flags & BPF_FLOW_DISSECTOR_F_PARSE_1ST_FRAG))
> >>                         return export_flow_keys(keys, BPF_OK);
> >> +       } else {
> >> +               return export_flow_keys(keys, BPF_OK);
> >>         }
> >>
> >>         return parse_ipv6_proto(skb, fragh->nexthdr);
> >> --
> >> 2.29.2
> >>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ