summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLi RongQing <lirongqing@baidu.com>2019-02-26 17:13:56 +0800
committerPablo Neira Ayuso <pablo@netfilter.org>2019-03-01 14:34:24 +0100
commita9f5e78c403d2d62ade4f4c85040efc85f4049b8 (patch)
tree8f482aa30652a6cb1f3cd05806115467a7236811 /include
parentcd6428988bf4fcc41d1deb7dae0e92e62c075c57 (diff)
downloadlinux-stable-a9f5e78c403d2d62ade4f4c85040efc85f4049b8.tar.gz
linux-stable-a9f5e78c403d2d62ade4f4c85040efc85f4049b8.tar.bz2
linux-stable-a9f5e78c403d2d62ade4f4c85040efc85f4049b8.zip
netfilter: nf_tables: check the result of dereferencing base_chain->stats
Check the result of dereferencing base_chain->stats, instead of result of this_cpu_ptr with NULL. base_chain->stats maybe be changed to NULL when a chain is updated and a new NULL counter can be attached. And we do not need to check returning of this_cpu_ptr since base_chain->stats is from percpu allocator if it is non-NULL, this_cpu_ptr returns a valid value. And fix two sparse error by replacing rcu_access_pointer and rcu_dereference with READ_ONCE under rcu_read_lock. Thanks for Eric's help to finish this patch. Fixes: 009240940e84c1 ("netfilter: nf_tables: don't assume chain stats are set when jumplabel is set") Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: Zhang Yu <zhangyu31@baidu.com> Signed-off-by: Li RongQing <lirongqing@baidu.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions