Netdev List
 help / color / mirror / Atom feed
From: Matthieu Baerts <matttbe@kernel.org>
To: Hyunwoo Kim <imv4bel@gmail.com>
Cc: martineau@kernel.org, geliang@kernel.org, pabeni@redhat.com,
	mptcp@lists.linux.dev, netdev@vger.kernel.org
Subject: Re: [PATCH mptcp-net v2] mptcp: fix use-after-free of the subflow context on the delegated list
Date: Thu, 19 Nov 2026 20:13:23 +0100	[thread overview]
Message-ID: <4e209707-bdc4-415a-923b-4ac1d2006ecf@kernel.org> (raw)
In-Reply-To: <auqd0rAI95jDSMvu@v4bel>

Hi Hyunwoo,

On 04/11/2026 03:52, Hyunwoo Kim wrote:
> mptcp_subflow_delegate() links the subflow context into a per-CPU napi
> list and takes a reference on the subflow socket. The context is a
> separate allocation, reached through icsk_ulp_data, and the list holds
> no reference to it.
> 
> inet_csk_destroy_sock() runs sk_prot->destroy() regardless of the
> outstanding references. That path ends in tcp_cleanup_ulp(), which calls
> subflow_ulp_release(). subflow_ulp_release() frees the context with
> kfree_rcu() but does not remove it from the list. Once the grace period
> elapses and the context is actually freed, the next mptcp_napi_poll()
> dequeues that entry and mptcp_subflow_delegated_next() writes to the
> freed context with list_del_init(). That is the use-after-free.

Thank you for this new version, it looks good to me:

Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>

Sorry for the delay. Please next time either use 'mptcp-ne(x)t' prefix
and send the patch only to the MPTCP mailing list (without netdev), or
use the 'net(-next)' one with the netdev ML.

@Net maintainers: If it is not OK to apply this patch directly in -net
because it is too late or because netdev maintainers have not been CCed
(which I understand), I can send it later with other fixes, no problem.

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


      reply	other threads:[~2026-11-19 19:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04  2:52 [PATCH mptcp-net v2] mptcp: fix use-after-free of the subflow context on the delegated list Hyunwoo Kim
2026-11-19 19:13 ` Matthieu Baerts [this message]

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=4e209707-bdc4-415a-923b-4ac1d2006ecf@kernel.org \
    --to=matttbe@kernel.org \
    --cc=geliang@kernel.org \
    --cc=imv4bel@gmail.com \
    --cc=martineau@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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