netfilter: xt_NFLOG: fix unexpected truncated packet
authorLiping Zhang <liping.zhang@spreadtrum.com>
Tue, 11 Oct 2016 13:03:45 +0000 (21:03 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Nov 2016 15:38:56 +0000 (16:38 +0100)
commitcc94524e89408dab9830cf9822c0e499b1275f36
tree931bc481a6dbd9f9064fa0ded8e46d90e9b32541
parent720a40113e78fd9377b7852a4bf6a72b085a926e
netfilter: xt_NFLOG: fix unexpected truncated packet

commit 6d19375b58763fefc2f215fb45117d3353ced888 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/netfilter/xt_NFLOG.c