Skip to content

Commit 6d52a4a

Browse files
Florian Westphalummakynes
authored andcommitted
netfilter: nfnetlink_log: account for netlink header size
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: 9dfa1df ("netfilter: nf_log: account for size of NLMSG_DONE attribute") Reported-by: Yiming Qian <yimingqian591@gmail.com> Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent 76522fc commit 6d52a4a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

net/netfilter/nfnetlink_log.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ nfulnl_log_packet(struct net *net,
726726
+ nla_total_size(plen) /* prefix */
727727
+ nla_total_size(sizeof(struct nfulnl_msg_packet_hw))
728728
+ nla_total_size(sizeof(struct nfulnl_msg_packet_timestamp))
729-
+ nla_total_size(sizeof(struct nfgenmsg)); /* NLMSG_DONE */
729+
+ nlmsg_total_size(sizeof(struct nfgenmsg)); /* NLMSG_DONE */
730730

731731
if (in && skb_mac_header_was_set(skb)) {
732732
size += nla_total_size(skb->dev->hard_header_len)

0 commit comments

Comments
 (0)