]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_tables: fix wrong destroy anonymous sets if binding fails
authorLiping Zhang <liping.zhang@spreadtrum.com>
Sat, 11 Jun 2016 04:20:28 +0000 (12:20 +0800)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 15 Jun 2016 10:17:23 +0000 (12:17 +0200)
commit534eb758035735e1051bcb9adfb3623b1e1aa7b2
tree28099616ed619231311c804950b77f3401179245
parent36786b41eaf59527545f5a78e2e632dda3f740a4
netfilter: nf_tables: fix wrong destroy anonymous sets if binding fails

When we add a nft rule like follows:
  # nft add rule filter test tcp dport vmap {1: jump test}
-ELOOP error will be returned, and the anonymous set will be
destroyed.

But after that, nf_tables_abort will also try to remove the
element and destroy the set, which was already destroyed and
freed.

If we add a nft wrong rule, nft_tables_abort will do the cleanup
work rightly, so nf_tables_set_destroy call here is redundant and
wrong, remove it.

Signed-off-by: Liping Zhang <liping.zhang@spreadtrum.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_api.c