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]
Message-ID: <20220712170302.37685-1-kuniyu@amazon.com>
Date:   Tue, 12 Jul 2022 10:03:02 -0700
From:   Kuniyuki Iwashima <kuniyu@...zon.com>
To:     <edumazet@...gle.com>
CC:     <davem@...emloft.net>, <kuba@...nel.org>, <kuni1840@...il.com>,
        <kuniyu@...zon.com>, <netdev@...r.kernel.org>, <pabeni@...hat.com>,
        <subashab@...eaurora.org>
Subject: Re: [PATCH v1 net] tcp/udp: Make early_demux back namespacified.

From:   Eric Dumazet <edumazet@...gle.com>
Date:   Tue, 12 Jul 2022 18:51:51 +0200
> On Tue, Jul 12, 2022 at 6:33 PM Kuniyuki Iwashima <kuniyu@...zon.com> wrote:
> >
> > Commit e21145a9871a ("ipv4: namespacify ip_early_demux sysctl knob") made
> > it possible to enable/disable early_demux on a per-netns basis.  Then, we
> > introduced two knobs, tcp_early_demux and udp_early_demux, to switch it for
> > TCP/UDP in commit dddb64bcb346 ("net: Add sysctl to toggle early demux for
> > tcp and udp").  However, the .proc_handler() was wrong and actually
> > disabled us from changing the behaviour in each netns.
> 
> ...
> 
> > -int tcp_v4_early_demux(struct sk_buff *skb)
> > +void tcp_v4_early_demux(struct sk_buff *skb)
> >  {
> >         const struct iphdr *iph;
> >         const struct tcphdr *th;
> >         struct sock *sk;
> >
> >         if (skb->pkt_type != PACKET_HOST)
> > -               return 0;
> > +               return;
> >
> >         if (!pskb_may_pull(skb, skb_transport_offset(skb) + sizeof(struct tcphdr)))
> > -               return 0;
> > +               return;
> >
> >         iph = ip_hdr(skb);
> >         th = tcp_hdr(skb);
> >
> >         if (th->doff < sizeof(struct tcphdr) / 4)
> > -               return 0;
> > +               return;
> >
> >         sk = __inet_lookup_established(dev_net(skb->dev), &tcp_hashinfo,
> >                                        iph->saddr, th->source,
> > @@ -1740,7 +1740,7 @@ int tcp_v4_early_demux(struct sk_buff *skb)
> >                                 skb_dst_set_noref(skb, dst);
> >                 }
> >         }
> > -       return 0;
> > +       return;
> >  }
> >
> 
> You have a tendency of making your patches larger than needed.
> 
> If you fix a bug, please do not add 'cleanups'.

Ah sorry.  I thought it would be confusing if we just drop the returned
value when calling tcp_v4_early_demux().

I drop the part in v2 and send it to net-next after net is merged.

Thank you!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ