mbox series

[bpf,0/3] bpf, sockmap: Fix infinite recursion in sock_map_close

Message ID 20230113-sockmap-fix-v1-0-d3cad092ee10@cloudflare.com (mailing list archive)
Headers show
Series bpf, sockmap: Fix infinite recursion in sock_map_close | expand

Message

Jakub Sitnicki Jan. 13, 2023, 2:56 p.m. UTC
This patch set addresses the syzbot report in [1].

Please see patch #1 for the analysis and the fix.
Patches #2 & #3 add coverage to selftests.

I still need to address Eric's suggestion to break out of sock_map_close when we
detect that sock_map_close is calling itself. Will do it in a separate patch or
the next iteration, if there is any review feedback to address.

[1] https://lore.kernel.org/all/00000000000073b14905ef2e7401@google.com/

To: bpf@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: kernel-team@cloudflare.com
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andrii Nakryiko <andrii@kernel.org>

---
Jakub Sitnicki (3):
      bpf, sockmap: Check for any of tcp_bpf_prots when cloning a listener
      selftests/bpf: Pass BPF skeleton to sockmap_listen ops tests
      selftests/bpf: Cover listener cloning with progs attached to sockmap

 net/ipv4/tcp_bpf.c                                 |  3 +-
 .../selftests/bpf/prog_tests/sockmap_listen.c      | 81 +++++++++++++++++-----
 2 files changed, 64 insertions(+), 20 deletions(-)
---
base-commit: e7895f017b79410bf4591396a733b876dc1e0e9d
change-id: 20230113-sockmap-fix-83d0359301b7

Best regards,