Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [91.216.245.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F306925B31D for ; Thu, 26 Mar 2026 15:19:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.216.245.30 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774538374; cv=none; b=eF7PEK7g8JBnvAHxow0QRoAtHzR3dWgZpDMBiDFXmilSDNUQzkGsxQzgTcudd5UuQsRtbEtmJ9Ui31FrtZrlLIkNb3c9dWqoLAm74sdIKsaFKb2LHx5isdW6ln3AJP7JoHkaLPTIZU2bDTuQZbj2+6CKo1GGe1r0yuvv32wbdKU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774538374; c=relaxed/simple; bh=BlafNr+QNLKRDkQcE/ueJYzXCYuLD3BAU63UkEDsH4Y=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=OZE8cA/ZkiNOEs8EtfXtrebsV8GWtrQyewC+aCIg4IfFs8SQ78rZ33v3aTuKikTL4bZ+bY7oRKZzkwTduDmYm+m/eYN4WJ1F74G9hBYgRs9vtCvUeBsAgtau0JhIWWDCxtBPqiGKy0G8Tj+LGWRyYuWVAKbKBh8MZhgrqqryutY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=strlen.de; spf=pass smtp.mailfrom=Chamillionaire.breakpoint.cc; arc=none smtp.client-ip=91.216.245.30 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=strlen.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=Chamillionaire.breakpoint.cc Received: by Chamillionaire.breakpoint.cc (Postfix, from userid 1003) id A2FE5602F8; Thu, 26 Mar 2026 16:19:30 +0100 (CET) From: Florian Westphal To: Cc: Florian Westphal , Yiming Qian Subject: [PATCH nf] netfilter: nfnetlink_log: account for netlink header size Date: Thu, 26 Mar 2026 16:17:24 +0100 Message-ID: <20260326151730.16233-1-fw@strlen.de> X-Mailer: git-send-email 2.52.0 Precedence: bulk X-Mailing-List: netfilter-devel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This is a followup to an old bug fix: NLMSG_DONE needs to account for the netlink header size, not just the attribute size. This can result in a WARN splat + drop of the netlink message, but other than this there are no ill effects. Fixes: 9dfa1dfe4d5e ("netfilter: nf_log: account for size of NLMSG_DONE attribute") Reported-by: Yiming Qian Signed-off-by: Florian Westphal --- net/netfilter/nfnetlink_log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c index b35a90955e2e..ea80ea72a371 100644 --- a/net/netfilter/nfnetlink_log.c +++ b/net/netfilter/nfnetlink_log.c @@ -730,7 +730,7 @@ nfulnl_log_packet(struct net *net, + nla_total_size(plen) /* prefix */ + nla_total_size(sizeof(struct nfulnl_msg_packet_hw)) + nla_total_size(sizeof(struct nfulnl_msg_packet_timestamp)) - + nla_total_size(sizeof(struct nfgenmsg)); /* NLMSG_DONE */ + + nlmsg_total_size(sizeof(struct nfgenmsg)); /* NLMSG_DONE */ if (in && skb_mac_header_was_set(skb)) { size += nla_total_size(skb->dev->hard_header_len) -- 2.52.0