]> git.baikalelectronics.ru Git - kernel.git/commit
udp, bpf: Ignore connections in reuseport group after BPF sk lookup
authorJakub Sitnicki <jakub@cloudflare.com>
Sun, 26 Jul 2020 12:02:28 +0000 (14:02 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 31 Jul 2020 00:00:48 +0000 (02:00 +0200)
commit1d8c6857c5e2f160e5bd3e37de487ded3812c496
tree0d5f58ae0796b1877e0b04d50f25877c5fc95466
parentc1c5044017679b5e9796cd1cbf3c083190b90a9e
udp, bpf: Ignore connections in reuseport group after BPF sk lookup

When BPF sk lookup invokes reuseport handling for the selected socket, it
should ignore the fact that reuseport group can contain connected UDP
sockets. With BPF sk lookup this is not relevant as we are not scoring
sockets to find the best match, which might be a connected UDP socket.

Fix it by unconditionally accepting the socket selected by reuseport.

This fixes the following two failures reported by test_progs.

  # ./test_progs -t sk_lookup
  ...
  #73/14 UDP IPv4 redir and reuseport with conns:FAIL
  ...
  #73/20 UDP IPv6 redir and reuseport with conns:FAIL
  ...

Fixes: fea05a7701f0 ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net")
Reported-by: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20200726120228.1414348-1-jakub@cloudflare.com
net/ipv4/udp.c
net/ipv6/udp.c