netfilter: nf_tables: Fix a use after free in nft_immediate_destroy()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 14 Jul 2020 10:56:22 +0000 (13:56 +0300)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 15 Jul 2020 18:15:19 +0000 (20:15 +0200)
commit336f531ab17c3f480f8289d26c35bd48302ed085
tree98fff2d8afd4a89e15f7571368c935beb791be2a
parent4ff91fa0a3acd072c9a46ebe08a6e2471ddd3c95
netfilter: nf_tables: Fix a use after free in nft_immediate_destroy()

The nf_tables_rule_release() function frees "rule" so we have to use
the _safe() version of list_for_each_entry().

Fixes: d0e2c7de92c7 ("netfilter: nf_tables: add NFT_CHAIN_BINDING")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nft_immediate.c