mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michal Luczaj <mhal@rbox.co>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Song Liu <song@kernel.org>,
	Yonghong Song <yonghong.song@linux.dev>,
	Jiri Olsa <jolsa@kernel.org>,
	Emil Tsalapatis <emil@etsalapatis.com>,
	Ihor Solodrai <ihor.solodrai@linux.dev>,
	Shuah Khan <shuah@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	Lorenz Bauer <lmb@cloudflare.com>
Cc: bpf@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org, Sashiko <sashiko-bot@kernel.org>,
	Jakub Sitnicki <jakub@cloudflare.com>
Subject: Re: [PATCH bpf-next 2/3] bpf, sockmap: Restrict iter-context sockmap updates to iter/sockmap
Date: Mon, 2 Nov 2026 02:20:39 +0100	[thread overview]
Message-ID: <d60bea00-6273-427d-8fbe-ff59fb6d83fe@rbox.co> (raw)
In-Reply-To: <DMJHFZPKETD8.PUM30IJH9D66@gmail.com>

On 11/1/26 02:28, Alexei Starovoitov wrote:
>> Ah, sure. So the same bit for unix_reg_info left for later?
> Yes. iter/unix cannot update sockmap after this patch.

I've meant setting PTR_TRUSTED on bpf_iter__unix::unix_sk for the sake of
unix_sk-consuming functions other than map update. bpf_setsockopt() came to
my mind, but now I've realized it doesn't really need that. So this
PTR_TRUSTED it's just a preparation for plain-PTR_TO_BTF_ID removal?

>> I've noticed commit 7cc639dc45c5 ("bpf: Don't take an extension for an
>> iterator program") got merged. Should I post v2 with the env->prog->type
>> check dropped or you guys don't want to restrict iters anymore?
> 
> The former. We still want it.
> bpf-next doesn't close during merge window. Only people that
> can process patches get busier.

Ok, I got confused by Documentation/bpf/bpf_devel_QA.rst: "for the time
when the merge window is open, bpf-next will not be processed".

> Pls send the PTR_TRUSTED part in v2.
> 
> I'd also limit tracing_iter_filter() to iter/tcp and iter/udp.

Oh, right. Commit 4ddbcb886268 ("bpf: Add bpf_sock_destroy kfunc") says
bpf_sock_destroy() expects a locked sk. So if I get it right, with
bpf_iter__sockmap::sk being PTR_TRUSTED, we allow iter/sockmap to invoke
bpf_sock_destroy() on an unlocked sk?

As for now, v2 posted:
https://lore.kernel.org/bpf/20261102-sockmap-update-limit-iter-v2-0-e96a63c43b39@rbox.co/


  reply	other threads:[~2026-11-02  1:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16 21:09 [PATCH bpf-next 0/3] bpf, sockmap: Restrict iter-context sockmap updates to sockmap iterators Michal Luczaj
2026-10-16 21:09 ` [PATCH bpf-next 1/3] selftests/bpf: Remove sockmap update from bpf_iter_unix Michal Luczaj
2026-10-16 21:09 ` [PATCH bpf-next 2/3] bpf, sockmap: Restrict iter-context sockmap updates to iter/sockmap Michal Luczaj
2026-10-16 23:52   ` Alexei Starovoitov
2026-10-19 15:20     ` Michal Luczaj
2026-10-19 19:40       ` Alexei Starovoitov
2026-10-21 11:12         ` Michal Luczaj
2026-10-27 22:20           ` Michal Luczaj
2026-11-01  1:28           ` Alexei Starovoitov
2026-11-02  1:20             ` Michal Luczaj [this message]
2026-10-19 11:16   ` Jakub Sitnicki
2026-10-19 15:20     ` Michal Luczaj
2026-10-16 21:09 ` [PATCH bpf-next 3/3] selftests/bpf: Add negative test for sockmap update from non-sockmap iter Michal Luczaj

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=d60bea00-6273-427d-8fbe-ff59fb6d83fe@rbox.co \
    --to=mhal@rbox.co \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=emil@etsalapatis.com \
    --cc=ihor.solodrai@linux.dev \
    --cc=jakub@cloudflare.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=lmb@cloudflare.com \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --cc=sashiko-bot@kernel.org \
    --cc=shuah@kernel.org \
    --cc=song@kernel.org \
    --cc=yonghong.song@linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®