MPTCP Linux Development
 help / color / mirror / Atom feed
From: Geliang Tang <geliang@kernel.org>
To: Matthieu Baerts <matttbe@kernel.org>, mptcp@lists.linux.dev
Cc: Geliang Tang <tanggeliang@kylinos.cn>
Subject: Re: [PATCH mptcp-next v3] mptcp: fix skb_ext leak in fallback mode
Date: Sat, 12 Sep 2026 07:07:13 +0800	[thread overview]
Message-ID: <678908417d5f8b872228daa6620b7934b7093222.camel@kernel.org> (raw)
In-Reply-To: <19934016-686b-45f1-91de-8ff29e5a7a06@kernel.org>

Hi Matt,

Thanks for the review.

On Wed, 2026-09-02 at 12:20 +0200, Matthieu Baerts wrote:
> Hi Geliang,
> 
> On 02/09/2026 10:39, Geliang Tang wrote:
> > From: Geliang Tang <tanggeliang@kylinos.cn>
> > 
> > In fallback mode, MPTCP sockets behave as plain TCP and should not
> > allocate
> > SKB_EXT_MPTCP for transmitted skbs. The current code
> > unconditionally
> > allocates the extension, causing memory leaks when skbs are freed
> > without
> > releasing it.
> 
> I'm surprised by this. Do you have kmemleak reports?
> 
> Or is it linked to this issue?
> 
>   https://github.com/multipath-tcp/mptcp_net-next/issues/583
> 
> I'm asking because I would think that such issues would have been
> caught
> by kmemleak, plus the fix is quite invasive.

This is another kmemleak, which only occurred when I ran the fallback
TLS test after enabling the TLS settings on the fallback socket.

> 
> > Fix by short-circuiting __mptcp_add_ext() in fallback mode and
> > skipping all
> > DSS bookkeeping in mptcp_sendmsg_frag(). Also allow TCP coalescing
> > when
> > mpext is NULL in fallback mode.
> > 
> > This latent bug will be exposed once TLS ULP support is added to
> > fallback
> > MPTCP sockets, as each sendmsg via the TLS path would leak one
> > skb_ext
> > object.
> 
> Do you mean this bug is only visible with the new feature? If yes,
> then
> no need to threat it as a fix.

In v4, I removed the "Fixes" tag and changed it to for "mptcp-next".

> 
> Then, I'm also wondering if this patch shouldn't be specific to this
> case: maybe less code should be modified to deal with fallback

Yes, it's a version with less code in v4, and it fixes the root cause
of this issue.

Thanks,
-Geliang

> sockets
> once this happens? (I'm probably missing context to really help here)
> 
> Cheers,
> Matt

      reply	other threads:[~2026-09-11 23:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-02  8:39 [PATCH mptcp-next v3] mptcp: fix skb_ext leak in fallback mode Geliang Tang
2026-09-02  9:55 ` MPTCP CI
2026-09-02 10:20 ` Matthieu Baerts
2026-09-11 23:07   ` Geliang Tang [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=678908417d5f8b872228daa6620b7934b7093222.camel@kernel.org \
    --to=geliang@kernel.org \
    --cc=matttbe@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=tanggeliang@kylinos.cn \
    /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