{"id":2215866,"url":"http://patchwork.ozlabs.org/api/patches/2215866/?format=json","web_url":"http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260325131108.23045-5-fw@strlen.de/","project":{"id":26,"url":"http://patchwork.ozlabs.org/api/projects/26/?format=json","name":"Netfilter Development","link_name":"netfilter-devel","list_id":"netfilter-devel.vger.kernel.org","list_email":"netfilter-devel@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260325131108.23045-5-fw@strlen.de>","list_archive_url":null,"date":"2026-03-25T13:10:58","name":"[net,04/14] netfilter: nfnetlink_log: fix uninitialized padding leak in NFULA_PAYLOAD","commit_ref":null,"pull_url":null,"state":"handled-elsewhere","archived":true,"hash":"b9403816ceba0891d91c16cf3fe592adcdec5341","submitter":{"id":1025,"url":"http://patchwork.ozlabs.org/api/people/1025/?format=json","name":"Florian Westphal","email":"fw@strlen.de"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260325131108.23045-5-fw@strlen.de/mbox/","series":[{"id":497441,"url":"http://patchwork.ozlabs.org/api/series/497441/?format=json","web_url":"http://patchwork.ozlabs.org/project/netfilter-devel/list/?series=497441","date":"2026-03-25T13:10:55","name":"[net,01/14] netfilter: nft_set_pipapo_avx2: don't return non-matching entry on expiry","version":1,"mbox":"http://patchwork.ozlabs.org/series/497441/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2215866/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2215866/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <netfilter-devel+bounces-11398-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","netfilter-devel@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=104.64.211.4; helo=sin.lore.kernel.org;\n envelope-from=netfilter-devel+bounces-11398-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=91.216.245.30","smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=strlen.de","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=Chamillionaire.breakpoint.cc"],"Received":["from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fgp5c1Htbz1y1K\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 00:43:32 +1100 (AEDT)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sin.lore.kernel.org (Postfix) with ESMTP id 2ABE9317DDA1\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 25 Mar 2026 13:12:39 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id C1C4B3D9041;\n\tWed, 25 Mar 2026 13:11:53 +0000 (UTC)","from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc\n [91.216.245.30])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 526603D6483;\n\tWed, 25 Mar 2026 13:11:52 +0000 (UTC)","by Chamillionaire.breakpoint.cc (Postfix, from userid 1003)\n\tid BA6D1609EF; Wed, 25 Mar 2026 14:11:50 +0100 (CET)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774444313; cv=none;\n b=XOYlThqxYuJJICi0sqZyPSy13fUL+NEHcucD2FXApPJwDlC05ioMlmutNlYMYb40vAdNJRpFoE8wEJyODwHkqsoWecPtbc6vK3kQqBMeeWlJeDazaZGKYkYd3hXJaE4gz0SMZnlYPL8Un5xiFn89ioHwGb5jWx1LR3No2j5GRMk=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774444313; c=relaxed/simple;\n\tbh=C/APzIA2zCHuO/wuvdSKZYqfaqdbCoOMXdZg50hkk6A=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=ARZbDfKgkk5S71dxtuq3VSXJXE/5bJYc4qJyV7hBY8Tdk/p7NUK17vKSzCDyiSXNMbyOAaYZUjxM75tXSfcXs+NFzi+soD8M0L/VYcvCGqcZRIO/bHBMzgl8xKGHss0U+bcRctIgmeLJOuGDb0YgjbJIpyv3gNI/xrFAxi8vOdE=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=strlen.de;\n spf=pass smtp.mailfrom=Chamillionaire.breakpoint.cc;\n arc=none smtp.client-ip=91.216.245.30","From":"Florian Westphal <fw@strlen.de>","To":"<netdev@vger.kernel.org>","Cc":"Paolo Abeni <pabeni@redhat.com>,\n\t\"David S. Miller\" <davem@davemloft.net>,\n\tEric Dumazet <edumazet@google.com>,\n\tJakub Kicinski <kuba@kernel.org>,\n\t<netfilter-devel@vger.kernel.org>,\n\tpablo@netfilter.org","Subject":"[PATCH net 04/14] netfilter: nfnetlink_log: fix uninitialized padding\n leak in NFULA_PAYLOAD","Date":"Wed, 25 Mar 2026 14:10:58 +0100","Message-ID":"<20260325131108.23045-5-fw@strlen.de>","X-Mailer":"git-send-email 2.52.0","In-Reply-To":"<20260325131108.23045-1-fw@strlen.de>","References":"<20260325131108.23045-1-fw@strlen.de>","Precedence":"bulk","X-Mailing-List":"netfilter-devel@vger.kernel.org","List-Id":"<netfilter-devel.vger.kernel.org>","List-Subscribe":"<mailto:netfilter-devel+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:netfilter-devel+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit"},"content":"From: Weiming Shi <bestswngs@gmail.com>\n\n__build_packet_message() manually constructs the NFULA_PAYLOAD netlink\nattribute using skb_put() and skb_copy_bits(), bypassing the standard\nnla_reserve()/nla_put() helpers. While nla_total_size(data_len) bytes\nare allocated (including NLA alignment padding), only data_len bytes\nof actual packet data are copied. The trailing nla_padlen(data_len)\nbytes (1-3 when data_len is not 4-byte aligned) are never initialized,\nleaking stale heap contents to userspace via the NFLOG netlink socket.\n\nReplace the manual attribute construction with nla_reserve(), which\nhandles the tailroom check, header setup, and padding zeroing via\n__nla_reserve(). The subsequent skb_copy_bits() fills in the payload\ndata on top of the properly initialized attribute.\n\nFixes: df6fb868d611 (\"[NETFILTER]: nfnetlink: convert to generic netlink attribute functions\")\nReported-by: Xiang Mei <xmei5@asu.edu>\nSigned-off-by: Weiming Shi <bestswngs@gmail.com>\nSigned-off-by: Florian Westphal <fw@strlen.de>\n---\n net/netfilter/nfnetlink_log.c | 8 ++------\n 1 file changed, 2 insertions(+), 6 deletions(-)","diff":"diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c\nindex b35a90955e2e..fcbe54940b2e 100644\n--- a/net/netfilter/nfnetlink_log.c\n+++ b/net/netfilter/nfnetlink_log.c\n@@ -647,15 +647,11 @@ __build_packet_message(struct nfnl_log_net *log,\n \n \tif (data_len) {\n \t\tstruct nlattr *nla;\n-\t\tint size = nla_attr_size(data_len);\n \n-\t\tif (skb_tailroom(inst->skb) < nla_total_size(data_len))\n+\t\tnla = nla_reserve(inst->skb, NFULA_PAYLOAD, data_len);\n+\t\tif (!nla)\n \t\t\tgoto nla_put_failure;\n \n-\t\tnla = skb_put(inst->skb, nla_total_size(data_len));\n-\t\tnla->nla_type = NFULA_PAYLOAD;\n-\t\tnla->nla_len = size;\n-\n \t\tif (skb_copy_bits(skb, 0, nla_data(nla), data_len))\n \t\t\tBUG();\n \t}\n","prefixes":["net","04/14"]}