All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steffen Klassert <steffen.klassert@secunet.com>
To: Paolo Abeni <pabeni@redhat.com>
Cc: Eric Dumazet <edumazet@kernel.org>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Simon Horman <horms@kernel.org>, <netdev@vger.kernel.org>,
	<syzbot+a3f21220cbbb6e14ee2e@syzkaller.appspotmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Subject: Re: [PATCH net] xfrm: iptfs: fix skb leak on error in __input_process_payload()
Date: Tue, 3 Nov 2026 10:51:28 +0000	[thread overview]
Message-ID: <aum8sFQdO_kGUWxX@gauss4> (raw)
In-Reply-To: <a555f856-0e74-4579-b35f-9e9c3ed5e8eb@redhat.com>

On Tue, Nov 03, 2026 at 09:45:28AM +0100, Paolo Abeni wrote:
> On 10/30/26 09:33, Eric Dumazet wrote:
> > syzbot reported a memory leak of the received skb (and its sec_path
> > extension) in the IP-TFS receive path.
> > 
> > __input_process_payload() parses the inner packets of an IP-TFS payload
> > and queues them on @sublist, which is only sent after the parsing loop.
> > Three error paths inside the loop (skb_copy_seq_read() failure, invalid
> > inner IPv4 header length, unknown IP version) jump to the "done" label,
> > which is placed after the code sending @sublist.
> > 
> > Any skb already queued on @sublist is then neither delivered nor freed.
> > This includes skbs added by iptfs_reassem_cont() before the call, newly
> > allocated inner packets, and, since the received skb can be reused for
> > the first inner packet, the received skb itself.
> > 
> > Move the "done" label before the trim/send code, so that inner packets
> > parsed before the error are delivered as on the normal exit path. The
> > received skb is then still freed (or consumed) as before when it was
> > not reused.
> > 
> > Fixes: 6c82d2433671 ("xfrm: iptfs: add basic receive packet (tunnel egress) handling")
> > Reported-by: syzbot+a3f21220cbbb6e14ee2e@syzkaller.appspotmail.com
> > Closes: https://lore.kernel.org/netdev/6ae4102e.9c6421ad.36baac.0005.GAE@google.com/
> > Signed-off-by: Eric Dumazet <edumazet@kernel.org>
> > ---
> > Cc: Steffen Klassert <steffen.klassert@secunet.com>
> > Cc: Herbert Xu <herbert@gondor.apana.org.au>
> 
> @Steffen, do you prefer to take this one via your tree? Otherwise, would you mind
> acking it?

I have a pending pull request for the ipsec tree, my plan
was to apply it once the PR is merged. But since the
ipsec tree is empty after the PR is merge, I could
also ack it if you prefer that.

Steffen

  reply	other threads:[~2026-11-03  8:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-30  8:33 [PATCH net] xfrm: iptfs: fix skb leak on error in __input_process_payload() Eric Dumazet
2026-11-03  8:45 ` Paolo Abeni
2026-11-03 10:51   ` Steffen Klassert [this message]
2026-11-03  9:59     ` Paolo Abeni
2026-11-03 11:15       ` Steffen Klassert
2026-11-03 11:40 ` patchwork-bot+netdevbpf

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=aum8sFQdO_kGUWxX@gauss4 \
    --to=steffen.klassert@secunet.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=syzbot+a3f21220cbbb6e14ee2e@syzkaller.appspotmail.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 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.