netfilter: nf_tables: don't assume chain stats are set when jumplabel is set
authorFlorian Westphal <fw@strlen.de>
Sat, 5 May 2018 22:47:20 +0000 (00:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 8 Jul 2018 13:30:49 +0000 (15:30 +0200)
commit4ae6a7afae5362289cc99aa80f7d6229521888c3
tree718b3d539efb6ae5ab49ddf4088206a5f464c2fe
parent365e73e07fba4c343510adf49d18cb2b97337df8
netfilter: nf_tables: don't assume chain stats are set when jumplabel is set

commit 009240940e84c1c089af88b454f7e804a4c5bd1b upstream.

nft_chain_stats_replace() and all other spots assume ->stats can be
NULL, but nft_update_chain_stats does not.  It must do this check,
just because the jump label is set doesn't mean all basechains have stats
assigned.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/netfilter/nf_tables_core.c