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] [day] [month] [year] [list]
Date:   Mon, 13 Aug 2018 12:47:43 -0700
From:   Yi-Hung Wei <yihung.wei@...il.com>
To:     William Tu <u9012063@...il.com>
Cc:     Pravin Shelar <pshelar@....org>,
        Linux Kernel Network Developers <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next] openvswitch: Derive IP protocol number for IPv6
 later frags

On Mon, Aug 13, 2018 at 10:48 AM William Tu <u9012063@...il.com> wrote:
> > > --- a/net/openvswitch/flow.c
> > > +++ b/net/openvswitch/flow.c
> > > @@ -297,7 +297,13 @@ static int parse_ipv6hdr(struct sk_buff *skb, struct sw_flow_key *key)
> > >
> > >         nh_len = payload_ofs - nh_ofs;
> > >         skb_set_transport_header(skb, nh_ofs + nh_len);
> > > -       key->ip.proto = nexthdr;
> > > +       if (key->ip.frag == OVS_FRAG_TYPE_LATER) {
> > > +               unsigned int offset = 0;
>
> How about we start the 2nd time parsing from
> unsigned int offset = payload_ofs;
>
> > > +
> > > +               key->ip.proto = ipv6_find_hdr(skb, &offset, -1, NULL, NULL);
>
> Then we only find the last header from previous parsed offset.
>
> William
>
> > > +       } else {
> > > +               key->ip.proto = nexthdr;
> > > +       }
> > parsing ipv6 ipv6_skip_exthdr() is called to find fragment hdr and
> > then this patch calls ipv6_find_hdr() to find next protocol. I think
> > we could call ipv6_find_hdr() to get fragment type and next hdr, that
> > would save parsing same packet twice in some cases.
> >
> > Other option would be calling ipv6_find_hdr() after setting OVS_FRAG_TYPE_LATER.

Thanks Pravin and William's feedback.

After looking into ipv6_find_hdr() more closely, I think we can just
call ipv6_find_hdr() once and derive everything we need.

I will submit the new patch once net-next is open.

Thanks,

-Yi-Hung

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ