From: Patrick McHardy <kaber@trash.net>
To: davem@davemloft.net
Cc: Patrick McHardy <kaber@trash.net>, netfilter-devel@vger.kernel.org
Subject: [NETFILTER 02/09]: nfnetlink_queue: fix computation of allocated size for netlink skb.
Date: Mon, 10 Mar 2008 19:26:16 +0100 (MET) [thread overview]
Message-ID: <20080310182618.20404.7439.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20080310182615.20404.67685.sendpatchset@localhost.localdomain>
[NETFILTER]: nfnetlink_queue: fix computation of allocated size for netlink skb.
Size of the netlink skb was wrongly computed because the formula was using
NLMSG_ALIGN instead of NLMSG_SPACE. NLMSG_ALIGN does not add the room for
netlink header as NLMSG_SPACE does. This was causing a failure of message
building in some cases.
On my test system, all messages for packets in range [8*k+41, 8*k+48] where k
is an integer were invalid and the corresponding packets were dropped.
Signed-off-by: Eric Leblond <eric@inl.fr>
Signed-off-by: Patrick McHardy <kaber@trash.net>
---
commit fab7718e07093ec0e51b1193560bae72d29b2ef1
tree 03084ce20b7f13470e8eb046326ac9592572e9f4
parent a0866e6699bd8bd0f5016eaf8a194c0f4dfd5f7e
author Eric Leblond <eric@inl.fr> Mon, 10 Mar 2008 17:50:41 +0100
committer Patrick McHardy <kaber@trash.net> Mon, 10 Mar 2008 17:50:41 +0100
net/netfilter/nfnetlink_queue.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c
index 385dacd..a573baa 100644
--- a/net/netfilter/nfnetlink_queue.c
+++ b/net/netfilter/nfnetlink_queue.c
@@ -224,7 +224,7 @@ nfqnl_build_packet_message(struct nfqnl_instance *queue,
struct net_device *indev;
struct net_device *outdev;
- size = NLMSG_ALIGN(sizeof(struct nfgenmsg))
+ size = NLMSG_SPACE(sizeof(struct nfgenmsg))
+ nla_total_size(sizeof(struct nfqnl_msg_packet_hdr))
+ nla_total_size(sizeof(u_int32_t)) /* ifindex */
+ nla_total_size(sizeof(u_int32_t)) /* ifindex */
next prev parent reply other threads:[~2008-03-10 18:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-10 18:26 [NETFILTER 00/09]: Netfilter fixes Patrick McHardy
2008-03-10 18:26 ` [NETFILTER 01/09]: nfnetlink: fix ifdef in nfnetlink_compat.h Patrick McHardy
2008-03-10 18:26 ` Patrick McHardy [this message]
2008-03-10 18:26 ` [NETFILTER 03/09]: nfnetlink_log: fix computation of netlink skb size Patrick McHardy
2008-03-10 18:26 ` [NETFILTER 04/09]: xt_time: fix failure to match on Sundays Patrick McHardy
2008-03-10 18:26 ` [NETFILTER 05/09]: nf_conntrack: add \n to "expectation table full" message Patrick McHardy
2008-03-10 18:26 ` [NETFILTER 06/09]: nf_conntrack: replace horrible hack with ksize() Patrick McHardy
2008-03-10 18:26 ` [NETFILTER 07/09]: nfnetlink_log: fix EPERM when binding/unbinding and instance 0 exists Patrick McHardy
2008-03-10 18:26 ` [NETFILTER 08/09]: nfnetlink_queue: " Patrick McHardy
2008-03-10 18:26 ` [NETFILTER 09/09]: nf_queue: don't return error when unregistering a non-existant handler Patrick McHardy
2008-03-10 23:45 ` [NETFILTER 00/09]: Netfilter fixes David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080310182618.20404.7439.sendpatchset@localhost.localdomain \
--to=kaber@trash.net \
--cc=davem@davemloft.net \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.