netfilter: nfnetlink_log: account for netlink header size
Subsystems (2)
Florian Westphal
maintainerPATCH 1/1 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 9dfa1dfe4d5e ("netfilter: nf_log: account for size of NLMSG_DONE attribute")
Reported-by Yiming Qian <[email protected]>
Signed-off-by Florian Westphal <[email protected]>
--- net/netfilter/nfnetlink_log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nfnetlink_log.c +1 -1
@@ -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)
Signature · 1 line
2.52.0