From: Matthieu Baerts <matttbe@kernel.org>
To: Jiayuan Chen <jiayuan.chen@linux.dev>,
bpf@vger.kernel.org, mptcp@lists.linux.dev
Cc: VEGA <vega@nebusec.ai>, Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
John Fastabend <john.fastabend@gmail.com>,
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>,
Mat Martineau <martineau@kernel.org>,
Geliang Tang <geliang@kernel.org>,
Matt Bobrowski <mattbobrowski@google.com>,
Tejun Heo <tj@kernel.org>,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
netdev@vger.kernel.org,
Kalpan Jani <kalpan.jani@mpiricsoftware.com>,
Paolo Abeni <pabeni@redhat.com>
Subject: Re: [PATCH bpf v1 1/2] mptcp, bpf: reject bpf_sk_release() on msk
Date: Thu, 17 Sep 2026 11:39:13 +0200 [thread overview]
Message-ID: <18f86b06-7477-4750-b57e-094df4310e4a@kernel.org> (raw)
In-Reply-To: <20260917081209.361367-1-jiayuan.chen@linux.dev>
Hi Jiayuan,
+Cc Kalpan, Paolo.
On 17/09/2026 10:11, Jiayuan Chen wrote:
> A bpf prog can do this today:
>
> subflow = bpf_skc_lookup_tcp(...);
> msk = bpf_skc_to_mptcp_sock(subflow);
> bpf_sk_release(msk);
>
> bpf_skc_to_mptcp_sock() returns subflow->conn without taking any
> reference, so bpf_sk_release() drops a refcount nobody took on the msk,
> and the subflow reference is leaked:
Thank you for looking at this!
Note that Kalpan was looking at this [1], and Paolo suggested removing
the helper [2] (but we failed to review the last version so far, sorry
about that...)
I don't know if there are progs already using it. If yes, I guess your
approach is better (but I'm not comfortable reviewing verifier's code).
@Kalpan, WDYT?
[1] https://lore.kernel.org/20260818120437.3949686-1-kalpan.jani@mpiricsoftware.com
[2] https://lore.kernel.org/e039e866-fe7e-41ef-ad41-92a76a123713@redhat.com
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
next prev parent reply other threads:[~2026-09-17 9:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-17 8:11 Jiayuan Chen
2026-09-17 8:11 ` [PATCH bpf v1 2/2] selftests/bpf: add verifier tests for bpf_skc_to_mptcp_sock Jiayuan Chen
2026-09-17 9:19 ` bot+bpf-ci
2026-09-17 9:39 ` Matthieu Baerts [this message]
2026-09-17 11:06 ` [PATCH bpf v1 1/2] mptcp, bpf: reject bpf_sk_release() on msk Kalpan Jani
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=18f86b06-7477-4750-b57e-094df4310e4a@kernel.org \
--to=matttbe@kernel.org \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=emil@etsalapatis.com \
--cc=geliang@kernel.org \
--cc=ihor.solodrai@linux.dev \
--cc=jiayuan.chen@linux.dev \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kalpan.jani@mpiricsoftware.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=martineau@kernel.org \
--cc=mattbobrowski@google.com \
--cc=memxor@gmail.com \
--cc=mptcp@lists.linux.dev \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=tj@kernel.org \
--cc=vega@nebusec.ai \
--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®