All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Sitnicki <jakub@cloudflare.com>
To: netdev@vger.kernel.org
Cc: kernel-team@cloudflare.com,
	John Fastabend <john.fastabend@gmail.com>,
	Eric Dumazet <edumazet@google.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>
Subject: [PATCH bpf 0/3] bpf, sockmap: Fix infinite recursion in sock_map_close
Date: Fri, 13 Jan 2023 15:56:20 +0100	[thread overview]
Message-ID: <20230113-sockmap-fix-v1-0-d3cad092ee10@cloudflare.com> (raw)

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,
-- 
Jakub Sitnicki <jakub@cloudflare.com>

             reply	other threads:[~2023-01-13 15:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-13 14:56 Jakub Sitnicki [this message]
2023-01-13 14:56 ` [PATCH bpf 1/3] bpf, sockmap: Check for any of tcp_bpf_prots when cloning a listener Jakub Sitnicki
2023-01-14  2:48   ` kernel test robot
2023-01-14  8:04     ` Dan Carpenter
2023-01-16 10:09     ` Jakub Sitnicki
2023-01-16 10:39       ` Eric Dumazet
2023-01-16 11:27         ` Jakub Sitnicki
2023-01-16 11:13       ` Dan Carpenter
2023-01-16 11:31         ` Jakub Sitnicki
2023-01-16 11:53           ` Dan Carpenter
2023-01-13 14:56 ` [PATCH bpf 2/3] selftests/bpf: Pass BPF skeleton to sockmap_listen ops tests Jakub Sitnicki
2023-01-13 14:56 ` [PATCH bpf 3/3] selftests/bpf: Cover listener cloning with progs attached to sockmap Jakub Sitnicki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230113-sockmap-fix-v1-0-d3cad092ee10@cloudflare.com \
    --to=jakub@cloudflare.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=edumazet@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=kernel-team@cloudflare.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.