From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=62.96.220.36 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== 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== 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 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 ; Tue, 1 Dec 2026 12:44:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2AFC0606A32E Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=secunet.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=secunet.com 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 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 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) 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) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.secunet.com 187752080B 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== 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 Received: (nullmailer pid 1165754 invoked by uid 1000); Tue, 01 Dec 2026 12:43:55 -0000 From: Steffen Klassert To: David Miller , Jakub Kicinski CC: Herbert Xu , Steffen Klassert , Subject: [PATCH 01/22] xfrm: ipcomp: account full fragment pages in truesize Date: Tue, 1 Dec 2026 13:41:27 +0100 Message-ID: <20261201124252.1163254-2-steffen.klassert@secunet.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261201124252.1163254-1-steffen.klassert@secunet.com> References: <20261201124252.1163254-1-steffen.klassert@secunet.com> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: EXCH-04.secunet.de (10.32.0.184) To EXCH-01.secunet.de (10.32.0.171) From: Zhiling Zou 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 Link: https://bugtracker.nebusec.ai/f/13830 Assisted-by: LLM Signed-off-by: Zhiling Zou Signed-off-by: Steffen Klassert --- 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