🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #10145

Re: [PATCH net] xfrm: iptfs: fix skb leak on error in __input_process_payload()

#10145
From: Steffen Klassert
Date: Tue, 03 Nov 2026 10:51
39 lines
11194 bytes
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
Technical Details
Message-ID: <aum8sFQdO_kGUWxX@gauss4>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-355298-linux-kernel-netdev=dewy.ru
References: <20261030083358.2653599-1-edumazet@kernel.org> <a555f856-0e74-4579-b35f-9e9c3ed5e8eb@redhat.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-355298-linux-kernel-netdev=dewy.ru
From: steffen.klassert@secunet.com (Steffen Klassert)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net] xfrm: iptfs: fix skb leak on error in
 __input_process_payload()
Date: Tue, 3 Nov 2026 10:51:28 +0000
Organization: Usenet Network
Message-ID: <aum8sFQdO_kGUWxX@gauss4>
References: <20261030083358.2653599-1-edumazet@kernel.org>
 <a555f856-0e74-4579-b35f-9e9c3ed5e8eb@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Injection-Info: usenet.network;
	logging-data="3130865"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:0OGfspepylE5YLwYc1xGCYGIlig= sha256:D9qU8BEcNDMFD27bvIE0Ks54zg91xcSmmgsE5EXHCwI=
	sha1:Or1TLWjhsq5tWaD1eVuhkMertgE= sha256:KPJXxP280Pnrjz0qwMHjORoqziHEprBKpQ0Gki74rIE=
Content-Disposition: inline
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 2CA8D112792; Tue,  3 Nov 2026 12:24:11 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=secunet.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id iTVYt2tKHO7S;
	Tue,  3 Nov 2026 12:24:08 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-355298-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=secunet.com
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id ABA7F11220A; Tue,  3 Nov 2026 12:23:59 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id D085D28FA6; Tue,  3 Nov 2026 08:51:18 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1793695876;
	b=kLMjEPNl9oRyRTsV18WflEmViBIJ7zmRcE5+BQ8Sli4N0unqqYBV4GSYRF9Rp+QVl7Le
	 8Fqrp2tQplQpL9AcmybN5ijkzhH0mt/wvZtpKtTZ/iWX0h0qFm6FYWReH9hlcqEqgEi27
	 GJvL0YOZy1SeRV3mwGEiguYmil/kO5f547xWnNa17fMjZJVu/SNlY/AxdJ0ps602xiZj9
	 n5CszQH/fmcCpUBXe8QD7lgssPMtef6XOw3FTChZzFAoSJYB1UGOwr/Gm40hyYWGBiQi9
	 K+mbdR3eeUsBFvNRsqIaqp+awt2P5Dw5eb+pHogBTtPcppWjwxAHtEKRjZzptX1sLyA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793695876;
	h=X-Original-To:Received:DMARC-Filter:Received:X-Virus-Scanned:
	 Received:Received:DKIM-Filter:DKIM-Signature:Received:Received:Date:
	 From:To:CC:Subject:Message-ID:References:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:
	 X-ClientProxiedBy;
	bh=VO2bFv1GCNjpThVBF9gjl0Uq4uR+QEBbmD1npZ75Vg0=;
	b=PG++doRWMwHDszVKR2iMYnQwyiaM8MOpcBjrEJ4gPGCuWee9V5D79YstSFtekJ0vxbla
	 4abYxCKM1fsQsUQxPGkv3pKXlOtsDqpl5tGMfDxwAEvtQG2xuTchKsP8V9LfRpERPl8dL
	 OHwh5psSsLDSG04rfvtQMsB+j3qNn9TzpuD5HCNcl5wLHMmyhJq++I8S20SPz/WXEd4vQ
	 7qDJO0rR+3wosdqQbXvkeSAlXlOa0OCPJV60/19oEduin7tRZm8CB/iYe5NpV5aXsUnur
	 Bue5/EG0mRt3Hvl6EkH5F7s+ShsaSnof1C8gv0sA+saeYT5NKWr82Osag7MuPmvfTVw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=secunet.com header.i=@secunet.com header.a=rsa-sha256 header.s=202301 header.b=s6NH3TWq;
	dmarc=pass header.from=secunet.com;
	spf=pass smtp.mailfrom=secunet.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 02015606A330;
	Tue,  3 Nov 2026 08:51:16 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=secunet.com header.i=@secunet.com header.a=rsa-sha256 header.s=202301 header.b=s6NH3TWq
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=62.96.220.36
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793695875;
	b=i1q+g9uuIo974Hj5+fIFAl39pxYxKK9lfvris/cKF7mfhthPx7TQfyLCchOt77YMNSHC
	 R1WcqTabHJUQquhNEhyQFGfMtrslU84jdOzgfbCo4GpNGNjZHm6YoLHBOtH0doELYjjgb
	 F1xHySv1+UgHGhPVytKr2bbCJs1OupsL+qq3HfIgGgc7x1DNwVoh8+9iNnmTsD66ioMrE
	 QSBBWiTd8Ak+OBV57dc0iPDQm5SIzoj1JHThfm5bWiJB7DTIUAxC3ZDst5Hprv4nqOBEh
	 lrJavAJ0A30JHtYuMJGSejP20aYByk1sRh8OO/rmQRTmPFCYAnnJmQ4s+Bt5QskEJuA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793695875;
	h=DMARC-Filter:Received:X-Virus-Scanned:Received:Received:DKIM-Filter:
	 DKIM-Signature:Received:Received:Date:From:To:CC:Subject:Message-ID:
	 References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:
	 X-ClientProxiedBy;
	bh=VO2bFv1GCNjpThVBF9gjl0Uq4uR+QEBbmD1npZ75Vg0=;
	b=q8hJCWQrbZ2yUSoGWLwyu8b6CXVdW29NrWDOjMww+d/lR4LQrmWKS9YmGKTYc5Rc0T1Z
	 0+hE2hsmodhEEa6Gj8cBY/ssELwD0nnilwDb338hrRCO/LNxNNIyxcDPwbyF0r1iC6x/D
	 R3rCxB0ihW67l75qiLT+dwm1+4R/Bs0BClazoysszNIQ3ljph/fOBeuSiia/5YPDcfx5U
	 ajutUTcepKzTcu9VbrtoQvOpZltMdZ8U3lNP9J9s01rn86Ofs9kkXwBByw/oDuZSxP+b2
	 Vf1ZaCk3Stju+cmm+07/oXFwshubDaq2hS0rUBPFiHgupazYR/tzz1VAwogkR840TmQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=secunet.com;
	spf=pass smtp.mailfrom=secunet.com;
	dkim=pass header.d=secunet.com header.i=@secunet.com header.a=rsa-sha256 header.s=202301 header.b=s6NH3TWq;
	arc=none smtp.remote-ip=62.96.220.36
X-Received: from mx1.secunet.com (mx1.secunet.com [62.96.220.36])
	(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 91011606A324
	for <netdev@vger.kernel.org>; Tue,  3 Nov 2026 08:51:13 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 91011606A324
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=secunet.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=secunet.com
X-Received: from localhost (localhost [127.0.0.1])
	by mx1.secunet.com (Postfix) with ESMTP id 9652820518;
	Tue,  3 Nov 2026 09:51:11 +0100 (CET)
X-Virus-Scanned: by secunet
X-Received: from mx1.secunet.com ([127.0.0.1])
 by localhost (mx1.secunet.com [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id IhYU7fZPxIQ8; Tue,  3 Nov 2026 09:51:10 +0100 (CET)
X-Received: from EXCH-01.secunet.de (rl1.secunet.de [10.32.0.231])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by mx1.secunet.com (Postfix) with ESMTPS id 4460520520;
	Tue,  3 Nov 2026 09:51:10 +0100 (CET)
X-DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.secunet.com 4460520520
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secunet.com;
	s=202301; t=1793695870;
	bh=VO2bFv1GCNjpThVBF9gjl0Uq4uR+QEBbmD1npZ75Vg0=;
	h=Date:From:To:CC:Subject:References:In-Reply-To:From;
	b=s6NH3TWqrSsglkkSHS1WN0oWzK8F8I5FTdFNWQiR4Zvfc0b6xnhXUjrOhFtl5lPk7
	 SJCABAwUkcFtV1g/1+A0/NMPCCF3goZJvfQChpWLyL940c5wYr/0fcLNGQFLhqcwbi
	 EwtC0EUx0+v2W/t2xpqwW2BJj5HsDl26T06AGQMShmsWGPbhOra9qfM/m8dQQ+bth7
	 lWvObzruUC8pysME6ajoPWVosZ1TN7zKT6G+zNlXxRws3pdZTnOg+mvbt1v4gvUgZL
	 wJxap7+CHTRjohLlpMYbjdR4LTGE1LEMCoZNZecr6W0BThUsWelsI0tqDYntEB54xH
	 XHuwyTbd1+EiA==
X-Received: from gauss4 (10.182.7.102) by EXCH-01.secunet.de (10.32.0.171) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.49; Tue, 3 Nov
 2026 09:51:09 +0100
X-Received: (nullmailer pid 3688640 invoked by uid 1000);
	Tue, 03 Nov 2026 10:51:28 -0000
X-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>
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <a555f856-0e74-4579-b35f-9e9c3ed5e8eb@redhat.com>
X-ClientProxiedBy: EXCH-04.secunet.de (10.32.0.184) To EXCH-01.secunet.de
 (10.32.0.171)