🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #25263

[PATCH 01/22] xfrm: ipcomp: account full fragment pages in truesize

#25263
From: Steffen Klassert
Date: Tue, 01 Dec 2026 12:41
40 lines
10594 bytes
From: Zhiling Zou <zhilinz@nebusec.ai>

ipcomp_post_acomp() allocates order-0 pages for decompressed skb
fragments, but on input charges truesize by the decompressed byte count.
When the output ends partway through a page, the unused tail of its final
page is not accounted to the receiving socket. Repeated IPComp packets
can therefore retain more memory than the socket receive-memory limits
charge.

Round the decompressed length up to page size when charging input skb
truesize, matching the pages attached to the skb. Leave output accounting
unchanged.

Fixes: 7d7e5a60c62e ("ipsec: ipcomp - Decompress into frags if necessary")
Cc: stable@vger.kernel.org
Reported-by: Vega <vega@nebusec.ai>
Link: https://bugtracker.nebusec.ai/f/13830
Assisted-by: LLM
Signed-off-by: Zhiling Zou <zhilinz@nebusec.ai>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
 net/xfrm/xfrm_ipcomp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/xfrm/xfrm_ipcomp.c b/net/xfrm/xfrm_ipcomp.c
index 671d48f8c937..c2cc88c8c360 100644
--- a/net/xfrm/xfrm_ipcomp.c
+++ b/net/xfrm/xfrm_ipcomp.c
@@ -67,7 +67,7 @@ static int ipcomp_post_acomp(struct sk_buff *skb, int err, int hlen)
 
 	/* Only update truesize on input. */
 	if (!hlen)
-		skb->truesize += dlen;
+		skb->truesize += PAGE_ALIGN(dlen);
 	skb->data_len = dlen;
 	skb->len += dlen;
 
-- 
2.53.0
Technical Details
Message-ID: <20261201124252.1163254-2-steffen.klassert@secunet.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375051-linux-kernel-netdev=dewy.ru
References: <20261201124252.1163254-1-steffen.klassert@secunet.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375051-linux-kernel-netdev=dewy.ru
From: steffen.klassert@secunet.com (Steffen Klassert)
Newsgroups: linux.kernel.netdev
Subject: [PATCH 01/22] xfrm: ipcomp: account full fragment pages in truesize
Date: Tue, 1 Dec 2026 13:41:27 +0100
Organization: Usenet Network
Message-ID: <20261201124252.1163254-2-steffen.klassert@secunet.com>
References: <20261201124252.1163254-1-steffen.klassert@secunet.com>
MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1712525"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:A3boxaOUFFauHQfsWqcEoR9Am9U= sha256:IGgp+KMs9VVL2lavRw03TfDsEBiT4M1wzIloAblY0tY=
	sha1:/spKSAfEg+EWjn6PwdFjIsw6wLI= sha256:uxYc+QZMFKJXWgXCfwtLQY1GJE5FwHk7eO9H/IMAV88=
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 E3E64117395; Tue,  1 Dec 2026 15:45:12 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.05
X-Spam-Status: No, score=-3.05 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, URIBL_BLOCKED=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 GRuXX4cBArho;
	Tue,  1 Dec 2026 15:45:09 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-375051-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 6C53611737D; Tue,  1 Dec 2026 15:45:01 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id E44F8275E8; Tue,  1 Dec 2026 12:44:39 +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=1796129060;
	b=WGW2K9ton7izh5Fj/IBGaPRGg0J696lG3jVz4SagBQRPy6FHwKjCJVOxDn/t6mB7mcN1
	 hRguClOF/n4MO7QUTwTPC9RixjiYZXKkIwaVukGu0GryVlESBLbkO0Djl4xhO1Eawbgyb
	 Hii9U+NmLiqVSgKIBGnoIVrsimX4wmCvRQY+vfNxGJmcv009miGZBEN36uF0VM3hst3j2
	 qaOccVUx2UeXxD++c+eS8haOYQPeBQGvVoNK0SDFTTrIEUAx91lrsrQgNyAtL+KJQ/Y3m
	 89GiSPi5E3urteB2PoYoCfSvwlzNtumF8CKgM0G0TthDWN10a/JuLXwXl07QE3OUJ2g==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796129060;
	h=X-Original-To:Received:DMARC-Filter:Received:X-Virus-Scanned:
	 Received:Received:DKIM-Filter:DKIM-Signature:Received:Received:From:
	 To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding:Content-Type:X-ClientProxiedBy;
	bh=SyzrM4ph5gS7cYv9SCud9VEC+tIQpeQu1r98in5AgGo=;
	b=ZXNo7LoOdxQKjD96Cn+Tn1n+BjoW1TLWfkQCaS8WzZ6nwooVLRLNxujPtz+cjIli6IIs
	 ZuVe34SI+1eZKWUj0+BlkHIT/2nhTwB4mzCtYjGb+xiRNll6Fi+vgetHah8MKb/Vfi4mN
	 jEhNIhVEgkhXWpHMcZ4YLqEOgpr0WXjx1lppT5WCc2pgaKYBSx3pLUSbDGX+VKRBMYPQO
	 2/k5Mq9QbTcR2m+UXI6oajOscUwlDSsfA8IuEHmOo+wi8iumSlrpxTeXe2UhTL1XC99ku
	 p66BHKF5B+j+aQpgD2ZJHvDHc9MCXj9QpwDw1DWhW97W41AIoMos3V+BFDGktv9sbVg==
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=KbHQnD8A;
	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 77EB0606A32A;
	Tue,  1 Dec 2026 12:44:20 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=secunet.com header.i=@secunet.com header.a=rsa-sha256 header.s=202301 header.b=KbHQnD8A
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=1796129059;
	b=48sVxrMq0EClONTur0ebjL6okss0yQ5YU3lvNHVw4mwHtwWfd4OQCyaUYvnC8RlSw3KB
	 OKWJV8DZTNB0pI9UCX+VCbX9WyIL8B+DRS+9IhfJ/SYpMfVeVxrqHGM/KofwTRfwOAnKZ
	 HTpjNPp5X2BYifKfcJWX+FVI+XyCKyN3Wg2cpB0i0f9kX/I1bfMHYD9/mIdGgFjG8hcnR
	 nEd3KUUYNwYbKIWvAOrG38sQ4pEomSMKUrpfr16W4INf4lbeVv+tLcAtcK9r3R8e8BXMj
	 NqIAeAIp5J1jDtD4KbOQ57hyoVUZaszc65sgjH9yq6Oc+2GKUzGnHiD1kX8GaKdEKgA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796129059;
	h=DMARC-Filter:Received:X-Virus-Scanned:Received:Received:DKIM-Filter:
	 DKIM-Signature:Received:Received:From:To:CC:Subject:Date:Message-ID:
	 X-Mailer:In-Reply-To:References:MIME-Version:
	 Content-Transfer-Encoding:Content-Type:X-ClientProxiedBy;
	bh=SyzrM4ph5gS7cYv9SCud9VEC+tIQpeQu1r98in5AgGo=;
	b=aDYPSrO2oHLIeNwKrr974HcQ/fwp3SJKJ2Qr0bOzC8VU2SMbFXeETx8yF0kiIrvqYbGg
	 SGtSSa/TMJVBWPtftmyGkAd5sMrfgDDZo6QBmsAJdkL4et4YIx73WlFGL6oNQlj9nS7Qj
	 jlK0jWsxnIPTEIAhZtKMppQCibPu5fMH13k1dEJVa/1vgzM0IV/GrUkunvIlT7EkBA799
	 YA1qI3Il55JfIE09768cBUK+O4/x+qSAPQvODTPd30kMLnIpBpMtGoqEDEjwIqn1qmNnr
	 LMzhqd/9yDhcuYR/VAftyRHiZO7EVg5a/JYtRktJ/A8h+l5cb5R2et+I2IUUquj2SdQ==
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=KbHQnD8A;
	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 2AFC0606A32E
	for <netdev@vger.kernel.org>; Tue,  1 Dec 2026 12:44:19 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2AFC0606A32E
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 EDEB9207B0;
	Tue,  1 Dec 2026 13:44:17 +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 YQYqVKVKLOcW; Tue,  1 Dec 2026 13:44:17 +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 187752080B;
	Tue,  1 Dec 2026 13:44:17 +0100 (CET)
X-DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.secunet.com 187752080B
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secunet.com;
	s=202301; t=1796129057;
	bh=SyzrM4ph5gS7cYv9SCud9VEC+tIQpeQu1r98in5AgGo=;
	h=From:To:CC:Subject:Date:In-Reply-To:References:From;
	b=KbHQnD8AS+dszGL3xLLZvackvbFyO6Lgpoa/VmNduC0HqHbWEbgekaCLE/bmD2U95
	 ZRHJnlFn732qKVA3n96axB5gMINqbygCBi7iUkv33DdZjo7rMPWX3dyh1IwZfS6MXq
	 +ofqqoza5q5cgmidB/VQBcp/pJx237NAN901xYYvch0gHn9rBB5Bk4KLau5DP5HhGv
	 Tw5yHWJTIqV6Sk0CJImbQib3VFedUiyRLGlLe8XJEyDWUeZG29j5xobp2ZCgzOWWCo
	 mNW2wAD1J+1GlXiMVILp9PAkhwt8W0x3rSVZkyKYLNL+aruVpJD0cLmMJF1iUVPF7p
	 S38lLmywLEQGA==
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, 1 Dec
 2026 13:44:16 +0100
X-Received: (nullmailer pid 1165754 invoked by uid 1000);
	Tue, 01 Dec 2026 12:43:55 -0000
X-CC: Herbert Xu <herbert@gondor.apana.org.au>, Steffen Klassert
	<steffen.klassert@secunet.com>, <netdev@vger.kernel.org>
X-Mailer: git-send-email 2.53.0
X-In-Reply-To: <20261201124252.1163254-1-steffen.klassert@secunet.com>
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-ClientProxiedBy: EXCH-04.secunet.de (10.32.0.184) To EXCH-01.secunet.de
 (10.32.0.171)