]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_tables: fix possible oops when dumping stateful objects
authorLiping Zhang <zlpnobody@gmail.com>
Sat, 7 Jan 2017 12:51:50 +0000 (20:51 +0800)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 16 Jan 2017 13:23:02 +0000 (14:23 +0100)
commit3c91b6b6bde9ae3dc37e6f6ceed76f31afb2087d
tree64c0279c2c99fad49b78a9c558e6e763b0406035
parent48c70b8b16e25a59b61455efaafe7492dcb5e13d
netfilter: nf_tables: fix possible oops when dumping stateful objects

When dumping nft stateful objects, if NFTA_OBJ_TABLE and NFTA_OBJ_TYPE
attributes are not specified either, filter will become NULL, so oops
will happen(actually nft utility will always set NFTA_OBJ_TABLE attr,
so I write a test program to make this happen):

  BUG: unable to handle kernel NULL pointer dereference at (null)
  IP: nf_tables_dump_obj+0x17c/0x330 [nf_tables]
  [...]
  Call Trace:
  ? nf_tables_dump_obj+0x5/0x330 [nf_tables]
  ? __kmalloc_reserve.isra.35+0x31/0x90
  ? __alloc_skb+0x5b/0x1e0
  netlink_dump+0x124/0x2a0
  __netlink_dump_start+0x161/0x190
  nf_tables_getobj+0xe8/0x280 [nf_tables]

Fixes: b68134b0cfa4 ("netfilter: nf_tables: allow to filter stateful object dumps by type")
Signed-off-by: Liping Zhang <zlpnobody@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_api.c