OSDN Git Service

netfilter: nf_tables: fix oops during rule dump
authorFlorian Westphal <fw@strlen.de>
Tue, 30 Apr 2019 12:53:11 +0000 (14:53 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 20 May 2019 17:45:23 +0000 (19:45 +0200)
commit2c82c7e724ff51cab78e1afd5c2aaa31994fe41e
tree9e3df6a164c6b0c99d006a919b5798c5529e0292
parentee8a2b95b737d5989efeb477d5a1ef5e6955b830
netfilter: nf_tables: fix oops during rule dump

We can oops in nf_tables_fill_rule_info().

Its not possible to fetch previous element in rcu-protected lists
when deletions are not prevented somehow: list_del_rcu poisons
the ->prev pointer value.

Before rcu-conversion this was safe as dump operations did hold
nfnetlink mutex.

Pass previous rule as argument, obtained by keeping a pointer to
the previous rule during traversal.

Fixes: d9adf22a291883 ("netfilter: nf_tables: use call_rcu in netlink dumps")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_api.c