]> git.ipfire.org Git - people/arne_f/kernel.git/commit
netfilter: nfnetlink_cttimeout: pass default timeout policy to obj_to_nlattr
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 12 Apr 2019 17:55:02 +0000 (10:55 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Apr 2019 06:38:46 +0000 (08:38 +0200)
commitc2d27b330a983d176311c1368037baa315fa0fd6
treebcf75aa2895f68761833b4817fa138a3d6cee1c2
parent564f0391b7834528a6b96d0ad0b6c70683e9b37f
netfilter: nfnetlink_cttimeout: pass default timeout policy to obj_to_nlattr

commit 8866df9264a34e675b4ee8a151db819b87cce2d3 upstream

Otherwise, we hit a NULL pointer deference since handlers always assume
default timeout policy is passed.

  netlink: 24 bytes leftover after parsing attributes in process `syz-executor2'.
  kasan: CONFIG_KASAN_INLINE enabled
  kasan: GPF could be caused by NULL-ptr deref or user memory access
  general protection fault: 0000 [#1] PREEMPT SMP KASAN
  CPU: 0 PID: 9575 Comm: syz-executor1 Not tainted 4.19.0+ #312
  Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
  RIP: 0010:icmp_timeout_obj_to_nlattr+0x77/0x170 net/netfilter/nf_conntrack_proto_icmp.c:297

Fixes: c779e849608a ("netfilter: conntrack: remove get_timeout() indirection")
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Zubin Mithra <zsm@chromium.org>
Signed-off-by: Sasha Levin (Microsoft) <sashal@kernel.org>
net/netfilter/nfnetlink_cttimeout.c