netfilter: log: netns NULL ptr bug when calling from conntrack
Since (69b34fb9 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>
Showing
- include/net/netfilter/nf_log.h 2 additions, 1 deletioninclude/net/netfilter/nf_log.h
- include/net/netfilter/nfnetlink_log.h 2 additions, 1 deletioninclude/net/netfilter/nfnetlink_log.h
- net/bridge/netfilter/ebt_log.c 5 additions, 6 deletionsnet/bridge/netfilter/ebt_log.c
- net/bridge/netfilter/ebt_ulog.c 11 additions, 7 deletionsnet/bridge/netfilter/ebt_ulog.c
- net/ipv4/netfilter/ipt_ULOG.c 8 additions, 5 deletionsnet/ipv4/netfilter/ipt_ULOG.c
- net/netfilter/nf_log.c 1 addition, 1 deletionnet/netfilter/nf_log.c
- net/netfilter/nfnetlink_log.c 2 additions, 2 deletionsnet/netfilter/nfnetlink_log.c
- net/netfilter/xt_LOG.c 7 additions, 6 deletionsnet/netfilter/xt_LOG.c
- net/netfilter/xt_NFLOG.c 2 additions, 1 deletionnet/netfilter/xt_NFLOG.c
Please register or sign in to comment