netfilter: log: netns NULL ptr bug when calling from conntrack
authorHans Schillstrom <hans@schillstrom.com>
Wed, 15 May 2013 01:23:45 +0000 (01:23 +0000)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 15 May 2013 12:11:07 +0000 (14:11 +0200)
commit8cdb46da06ea94543a3b2e53e3e92736421d1093
tree2f3d5703ee736daf10a3556c5c80f6bcca8731b8
parent42010ed0c669aeb1c5b015f5edf590c73919380c
netfilter: log: netns NULL ptr bug when calling from conntrack

Since (69b34fb netfilter: xt_LOG: add net namespace support
for xt_LOG), we hit this:

[ 4224.708977] BUG: unable to handle kernel NULL pointer dereference at 0000000000000388
[ 4224.709074] IP: [<ffffffff8147f699>] ipt_log_packet+0x29/0x270

when callling log functions from conntrack both in and out
are NULL i.e. the net pointer is invalid.

Adding struct net *net in call to nf_logfn() will secure that
there always is a vaild net ptr.

Reported as netfilter's bugzilla bug 818:
https://bugzilla.netfilter.org/show_bug.cgi?id=818

Reported-by: Ronald <ronald645@gmail.com>
Signed-off-by: Hans Schillstrom <hans@schillstrom.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netfilter/nf_log.h
include/net/netfilter/nfnetlink_log.h
net/bridge/netfilter/ebt_log.c
net/bridge/netfilter/ebt_ulog.c
net/ipv4/netfilter/ipt_ULOG.c
net/netfilter/nf_log.c
net/netfilter/nfnetlink_log.c
net/netfilter/xt_LOG.c
net/netfilter/xt_NFLOG.c