{"id":2220993,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2220993/?format=json","web_url":"http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260408163512.30537-3-fw@strlen.de/","project":{"id":26,"url":"http://patchwork.ozlabs.org/api/1.1/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},"msgid":"<20260408163512.30537-3-fw@strlen.de>","date":"2026-04-08T16:35:07","name":"[net,2/7] netfilter: nfnetlink_log: initialize nfgenmsg in NLMSG_DONE terminator","commit_ref":null,"pull_url":null,"state":"accepted","archived":true,"hash":"08738672a02fac60adfa9ae86689d8472df0fb57","submitter":{"id":1025,"url":"http://patchwork.ozlabs.org/api/1.1/people/1025/?format=json","name":"Florian Westphal","email":"fw@strlen.de"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260408163512.30537-3-fw@strlen.de/mbox/","series":[{"id":499159,"url":"http://patchwork.ozlabs.org/api/1.1/series/499159/?format=json","web_url":"http://patchwork.ozlabs.org/project/netfilter-devel/list/?series=499159","date":"2026-04-08T16:35:05","name":"[net,1/7] ipvs: fix NULL deref in ip_vs_add_service error path","version":1,"mbox":"http://patchwork.ozlabs.org/series/499159/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2220993/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2220993/checks/","tags":{},"headers":{"Return-Path":"\n <netfilter-devel+bounces-11740-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=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=netfilter-devel+bounces-11740-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])\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 4frTJB5LkPz1xv0\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 09 Apr 2026 02:37:46 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 7B3C7305D1C0\n\tfor <incoming@patchwork.ozlabs.org>; Wed,  8 Apr 2026 16:35:28 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id A2FE03B27CA;\n\tWed,  8 Apr 2026 16:35:27 +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 3CCF0219EB;\n\tWed,  8 Apr 2026 16:35:26 +0000 (UTC)","by Chamillionaire.breakpoint.cc (Postfix, from userid 1003)\n\tid 00B0F60636; Wed, 08 Apr 2026 18:35:23 +0200 (CEST)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775666127; cv=none;\n b=mcKwzjLD590mjOhOjNhMQl4sNRY+zQLP9ts/kj4j1KAUDmenlUMfbxJQGC3c9FBKbl/dAMhWyxidKItQqo0LOR9MDpYSYWTtsClohvormeT37sIVZ7N03+6q7z/Ril4hzEq1SsAEgAIaNweAAlElPdbjkySzts1q5+D+/Kzzd90=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775666127; c=relaxed/simple;\n\tbh=yE+mZxz48RHTADVcyJox+zvWTLrTH0QDTxriO2Q255w=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=RxL+/pklG0NyJtBpsa7pVBmLSGgRRLl9kPL0qxTQ4GhCw8YH+z5dBfLEPivk2hste//FGQdN1lPR95mOc9o0M9Am4uYRtB4hDw4D147dovTcuKJLHkkEo/XmEXi9LZI64pgMhNYKcSfMRt87Bmxzh94mElQMskW+HcVb9XFsaEw=","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 2/7] netfilter: nfnetlink_log: initialize nfgenmsg in\n NLMSG_DONE terminator","Date":"Wed,  8 Apr 2026 18:35:07 +0200","Message-ID":"<20260408163512.30537-3-fw@strlen.de>","X-Mailer":"git-send-email 2.52.0","In-Reply-To":"<20260408163512.30537-1-fw@strlen.de>","References":"<20260408163512.30537-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: Xiang Mei <xmei5@asu.edu>\n\nWhen batching multiple NFLOG messages (inst->qlen > 1), __nfulnl_send()\nappends an NLMSG_DONE terminator with sizeof(struct nfgenmsg) payload via\nnlmsg_put(), but never initializes the nfgenmsg bytes. The nlmsg_put()\nhelper only zeroes alignment padding after the payload, not the payload\nitself, so four bytes of stale kernel heap data are leaked to userspace\nin the NLMSG_DONE message body.\n\nUse nfnl_msg_put() to build the NLMSG_DONE terminator, which initializes\nthe nfgenmsg payload via nfnl_fill_hdr(), consistent with how\n__build_packet_message() already constructs NFULNL_MSG_PACKET headers.\n\nFixes: 29c5d4afba51 (\"[NETFILTER]: nfnetlink_log: fix sending of multipart messages\")\nReported-by: Weiming Shi <bestswngs@gmail.com>\nSigned-off-by: Xiang Mei <xmei5@asu.edu>\nSigned-off-by: Florian Westphal <fw@strlen.de>\n---\n net/netfilter/nfnetlink_log.c | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)","diff":"diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c\nindex f80978c06fa0..0db908518b2f 100644\n--- a/net/netfilter/nfnetlink_log.c\n+++ b/net/netfilter/nfnetlink_log.c\n@@ -361,10 +361,10 @@ static void\n __nfulnl_send(struct nfulnl_instance *inst)\n {\n \tif (inst->qlen > 1) {\n-\t\tstruct nlmsghdr *nlh = nlmsg_put(inst->skb, 0, 0,\n-\t\t\t\t\t\t NLMSG_DONE,\n-\t\t\t\t\t\t sizeof(struct nfgenmsg),\n-\t\t\t\t\t\t 0);\n+\t\tstruct nlmsghdr *nlh = nfnl_msg_put(inst->skb, 0, 0,\n+\t\t\t\t\t\t    NLMSG_DONE, 0,\n+\t\t\t\t\t\t    AF_UNSPEC, NFNETLINK_V0,\n+\t\t\t\t\t\t    htons(inst->group_num));\n \t\tif (WARN_ONCE(!nlh, \"bad nlskb size: %u, tailroom %d\\n\",\n \t\t\t      inst->skb->len, skb_tailroom(inst->skb))) {\n \t\t\tkfree_skb(inst->skb);\n","prefixes":["net","2/7"]}