From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C97FD3C1998 for ; Mon, 31 Aug 2026 04:38:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788151087; cv=none; b=QOymrA+GDh9Luo20+rbxVizgmJy/hTilMZvgS/OZBHOZKmEg1g9LMqyiFOnQO7DxZTFbk4UsLQ4OYW//w6Ved9BXv+QsF+mbhhfSRvmCQBDAhVJKio4p7mDpbITtmSmKSvYGdLyAtRegZv8hUO9wQ5WjdndPrcvNlxRhvpdUlCU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788151087; c=relaxed/simple; bh=TSPukoHwuGOtlLSCKsfDe7vaSQqehsHcKRp+PP2zfx8=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=bKvdnK6D6bspskUkNMMcmxq1k+G8KxikFDQDQibAF1sADLzxmf/tsEVUVmSwgd6wJO0ib3wVbZU7eghD6sBUCbzk9RG//3IRxrijku0YZGR2xeYoQhtv9ekkHtdIdmAuXRnPXF7KjozwRRBsj1M4C7agPuVjMpR1VOTSUxzoqjM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Aq9BLN8k; arc=none smtp.client-ip=209.85.221.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Aq9BLN8k" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-482e5733a5aso1750015f8f.0 for ; Sun, 30 Aug 2026 21:38:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1788151084; x=1788755884; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=TGoBedQqRgsKG7wNi45We7BTQ5QQ5aS5jrqdXZyohA0=; b=Aq9BLN8k6bsE4sId3E2D0ABNkFXHZiC3HNXKofNT33evMqYLykTK9GFxD2WCWiI2PB MHnFmKFT0nIEvxN0kRpImutCmbe8kT9D8wz9uhCUlcwpan0jhcV2LZ7MlbTcB65FLtRt vTDA50OwF8Fr7kVXBFAq3Tj8ivdRTENez2zX2YmCF61vg8gwKj23S8Iquvz8PwFZNu77 A6HoJ/53Krzhi1E9rZVBuDk4IynVtTdWpJaDn8QtB3ymLxzfFZ3dzfkOBx5nnjnEzURk Pgkg0MsLA/Cijt1vCz8cvNFdYBf/xSSw76/flw02sS8zEFvlDNC0WCBxgnuHJmhSUxnz zQQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788151084; x=1788755884; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=TGoBedQqRgsKG7wNi45We7BTQ5QQ5aS5jrqdXZyohA0=; b=RpzQpXQCc0P1Cp54RHHIyn+6LSK3tgj06HSaKF2mhhgAdwJ8/fEkVEjuFck/nApF4f p7s/Hfwob1GQYvubwp0JiUHOs2PKZpviPQnFwQynYLjZpZAefigh3lbi0i18nA+08Mfc 4OkEAVjZ+AyNBK9uCYKeEg1Ml+TRwj5h4Duw+XY6Alk+IOLlGHaiwdK3CJNEPtjLtpkw wxCUv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250 with SMTP id 5b1f17b1804b1-49cd940c70emr9007825e9.2.1788151083769; Sun, 30 Aug 2026 21:38:03 -0700 (PDT) Received: from localhost.localdomain (dynamic-2a02-3100-acb9-0201-68d0-34d2-ad1a-175a.310.pool.telefonica.de. [2a02:3100:acb9:201:68d0:34d2:ad1a:175a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49cd775dae8sm79057735e9.9.2026.08.30.21.38.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 30 Aug 2026 21:38:02 -0700 (PDT) From: Karl Mehltretter To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bin Lan , XiaoHua Wang <561399680@139.com>, Karl Mehltretter Subject: [PATCH 6.1.y 6.6.y] netfilter: nft_set_pipapo: account mapping table allocation Date: Mon, 31 Aug 2026 06:37:55 +0200 Message-Id: <20260831043755.29692-1-kmehltretter@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit [ Upstream commit 69e687cea79fc99a17dfb0116c8644b9391b915e ] The pipapo set backend data structure is one of the ruleset objects that upstream changed to use GFP_KERNEL_ACCOUNT for memory accounting. The 6.1.y and 6.6.y adaptations changed the other pipapo allocations, but omitted the mapping table allocation in pipapo_realloc_mt() because that helper does not exist in these branches. The equivalent allocation is in pipapo_resize() and still uses GFP_KERNEL, so the persistent mapping table is not charged to the allocating memory cgroup. Update this allocation to use GFP_KERNEL_ACCOUNT. Fixes: a0bb39980635 ("netfilter: nf_tables: missing objects with no memcg accounting") Fixes: 1c4f72fa9699 ("netfilter: nf_tables: missing objects with no memcg accounting") Signed-off-by: Karl Mehltretter --- This patch is based on 6.6.155 and applies unchanged to the tested 6.1.y tip. The test configurations and full serial logs are retained in the audit dossier. A/B tests with a 32,768-element two-field concatenation set left two 262,144-byte mapping tables. The fixed kernels charged approximately 512 KiB more kernel memory to the child cgroup: 6.1.186: +524,288 bytes 6.6.155: +516,096 bytes The two-page difference on 6.6.y is within memory.stat measurement variation. Ruleset loading and element lookup succeeded before and after the change on both branches. Tested on: 6.1.y d64a499eea6b62b5121beceed9e8a1f57b00d863 (Linux 6.1.186) 6.6.y a4a971135a2ff64382ae4235b3ae60503bb1036a (Linux 6.6.155) net/netfilter/nft_set_pipapo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netfilter/nft_set_pipapo.c b/net/netfilter/nft_set_pipapo.c index 7c8d28a031ad5..8ba76eea3eb18 100644 --- a/net/netfilter/nft_set_pipapo.c +++ b/net/netfilter/nft_set_pipapo.c @@ -705,7 +705,7 @@ static int pipapo_resize(struct nft_pipapo_field *f, int old_rules, int rules) return -ENOMEM; } - new_mt = kvmalloc(rules * sizeof(*new_mt), GFP_KERNEL); + new_mt = kvmalloc(rules * sizeof(*new_mt), GFP_KERNEL_ACCOUNT); if (!new_mt) { kvfree(new_lt); return -ENOMEM; -- 2.39.5 (Apple Git-154)