netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: [PATCH 04/13] netfilter: xt_NFLOG: fix unexpected truncated packet
Date: Fri, 21 Oct 2016 12:12:14 +0200	[thread overview]
Message-ID: <1477044743-18948-5-git-send-email-pablo@netfilter.org> (raw)
In-Reply-To: <1477044743-18948-1-git-send-email-pablo@netfilter.org>

From: Liping Zhang <liping.zhang@spreadtrum.com>

Justin and Chris spotted that iptables NFLOG target was broken when they
upgraded the kernel to 4.8: "ulogd-2.0.5- IPs are no longer logged" or
"results in segfaults in ulogd-2.0.5".

Because "struct nf_loginfo li;" is a local variable, and flags will be
filled with garbage value, not inited to zero. So if it contains 0x1,
packets will not be logged to the userspace anymore.

Fixes: 7643507fe8b5 ("netfilter: xt_NFLOG: nflog-range does not truncate packets")
Reported-by: Justin Piszcz <jpiszcz@lucidpixels.com>
Reported-by: Chris Caputo <ccaputo@alt.net>
Tested-by: Chris Caputo <ccaputo@alt.net>
Signed-off-by: Liping Zhang <liping.zhang@spreadtrum.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 net/netfilter/xt_NFLOG.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/netfilter/xt_NFLOG.c b/net/netfilter/xt_NFLOG.c
index 018eed7e1ff1..8668a5c18dc3 100644
--- a/net/netfilter/xt_NFLOG.c
+++ b/net/netfilter/xt_NFLOG.c
@@ -32,6 +32,7 @@ nflog_tg(struct sk_buff *skb, const struct xt_action_param *par)
 	li.u.ulog.copy_len   = info->len;
 	li.u.ulog.group	     = info->group;
 	li.u.ulog.qthreshold = info->threshold;
+	li.u.ulog.flags	     = 0;
 
 	if (info->flags & XT_NFLOG_F_COPY_LEN)
 		li.u.ulog.flags |= NF_LOG_F_COPY_LEN;
-- 
2.1.4

  parent reply	other threads:[~2016-10-21 10:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-21 10:12 [PATCH 00/13] Netfilter fixes for net Pablo Neira Ayuso
2016-10-21 10:12 ` [PATCH 01/13] netfilter: xt_hashlimit: Add missing ULL suffixes for 64-bit constants Pablo Neira Ayuso
2016-10-21 10:12 ` [PATCH 02/13] netfilter: nft_dynset: fix element timeout for HZ != 1000 Pablo Neira Ayuso
2016-10-21 10:12 ` [PATCH 03/13] netfilter: conntrack: remove obsolete sysctl (nf_conntrack_events_retry_timeout) Pablo Neira Ayuso
2016-10-21 10:12 ` Pablo Neira Ayuso [this message]
2016-10-21 10:12 ` [PATCH 05/13] netfilter: xt_ipcomp: add "ip[6]t_ipcomp" module alias name Pablo Neira Ayuso
2016-10-21 10:12 ` [PATCH 06/13] netfilter: nft_hash: add missing NFTA_HASH_OFFSET's nla_policy Pablo Neira Ayuso
2016-10-21 10:12 ` [PATCH 07/13] netfilter: nf_tables: underflow in nft_parse_u32_check() Pablo Neira Ayuso
2016-10-21 10:12 ` [PATCH 08/13] netfilter: nft_exthdr: fix error handling in nft_exthdr_init() Pablo Neira Ayuso
2016-10-21 10:12 ` [PATCH 09/13] netfilter: nft_range: validate operation netlink attribute Pablo Neira Ayuso
2016-10-21 10:12 ` [PATCH 10/13] netfilter: nf_tables: avoid uninitialized variable warning Pablo Neira Ayuso
2016-10-21 10:12 ` [PATCH 11/13] netfilter: x_tables: suppress kmemcheck warning Pablo Neira Ayuso
2016-10-21 10:12 ` [PATCH 12/13] netfilter: conntrack: restart gc immediately if GC_MAX_EVICTS is reached Pablo Neira Ayuso
2016-10-21 10:12 ` [PATCH 13/13] netfilter: fix nf_queue handling Pablo Neira Ayuso
2016-10-21 14:25 ` [PATCH 00/13] Netfilter fixes for net 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=1477044743-18948-5-git-send-email-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).