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:   Fri, 24 Jul 2020 09:38:08 -0400
From:   Willem de Bruijn <willemdebruijn.kernel@...il.com>
To:     Kuniyuki Iwashima <kuniyu@...zon.co.jp>
Cc:     David Miller <davem@...emloft.net>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Jakub Sitnicki <jakub@...udflare.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Kuniyuki Iwashima <kuni1840@...il.com>,
        Network Development <netdev@...r.kernel.org>,
        Willem de Bruijn <willemdebruijn.kernel@...il.com>
Subject: Re: [PATCH net] udp: Remove an unnecessary variable in udp[46]_lib_lookup2().

On Fri, Jul 24, 2020 at 2:13 AM Kuniyuki Iwashima <kuniyu@...zon.co.jp> wrote:
>
> From:   David Miller <davem@...emloft.net>
> Date:   Thu, 23 Jul 2020 15:10:51 -0700 (PDT)
> > From: Kuniyuki Iwashima <kuniyu@...zon.co.jp>
> > Date: Thu, 23 Jul 2020 01:52:27 +0900
> >
> > > This patch removes an unnecessary variable in udp[46]_lib_lookup2() and
> > > makes it easier to resolve a merge conflict with bpf-next reported in
> > > the link below.
> > >
> > > Link: https://lore.kernel.org/linux-next/20200722132143.700a5ccc@canb.auug.org.au/
> > > Fixes: efc6b6f6c311 ("udp: Improve load balancing for SO_REUSEPORT.")
> > > Signed-off-by: Kuniyuki Iwashima <kuniyu@...zon.co.jp>
> > > Signed-off-by: Jakub Sitnicki <jakub@...udflare.com>
> > > Cc: Willem de Bruijn <willemdebruijn.kernel@...il.com>
> >
> > This doesn't apply to net-next.
>
> Yes. I think this kind of patch should be submitted to net-next, but this
> is for the net tree. Please let me add more description.
>
> Currently, the net and net-next trees conflict in udp[46]_lib_lookup2()
> between
>
>    efc6b6f6c311 ("udp: Improve load balancing for SO_REUSEPORT.")
>
> and
>
>    7629c73a1466 ("udp: Extract helper for selecting socket from reuseport group")
>    2a08748cd384 ("udp6: Extract helper for selecting socket from reuseport group")
> .
>
> The conflict is reported in the link[0] and Jakub suggested how to resolve
> it[1]. To ease the merge conflict, Jakub and I have to send follow up patches to
> the bpf-next and net trees.
>
> Now, his patchset (7629c73a1466 and 2a08748cd384) to bpf-next is merged
> into net-next, and his follow up patch is applied in bpf-next[2].
>
> I fixed a bug in efc6b6f6c311, but it introduced an unnecessary variable
> and made the conflict worse. So I sent this follow up patch to net tree.
>
> However, I do not know the best way to resolve the conflict, so any comments
> are welcome.

Perhaps simpler is to apply this change to bpf-next:

"
                        badness = score;
-                       result = sk;
+                       if (!result)
+                               result = sk;
"

After which the remaining conflict between bpf-next and net is

"
++<<<<<<< HEAD
 +                      result = lookup_reuseport(net, sk, skb,
 +                                                saddr, sport, daddr, hnum);
 +                      if (result && !reuseport_has_conns(sk, false))
 +                              return result;
 +
 +                      badness = score;
 +                      if (!result)
 +                              result = sk;
++=======
+                       reuseport_result = NULL;
+
+                       if (sk->sk_reuseport &&
+                           sk->sk_state != TCP_ESTABLISHED) {
+                               hash = udp_ehashfn(net, daddr, hnum,
+                                                  saddr, sport);
+                               reuseport_result =
reuseport_select_sock(sk, hash, skb,
+
  sizeof(struct udphdr));
+                               if (reuseport_result &&
!reuseport_has_conns(sk, false))
+                                       return reuseport_result;
+                       }
+
+                       result = reuseport_result ? : sk;
+                       badness = score;
++>>>>>>> netdev-net/master
"

And we can just take bpf-next HEAD. Either that or handle the
corresponding change in the merge fix-up itself.

(note that bpf-next is one patch ahead of netdev-nn)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ