]> www.infradead.org Git - users/jedix/linux-maple.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)
committerDhaval Giani <dhaval.giani@oracle.com>
Mon, 16 Jan 2017 21:38:00 +0000 (16:38 -0500)
commit9a091b4bd433c50b4b70612c13664638362ee182
tree5d416d61e82eaacbe60d1424476f2ac8b398c35b
parentf1f38375ef4601a639da985c8f9d2c75d4dc0174
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>
(cherry picked from commit a02f424863610a0a7abd80c468839e59cfa4d0d8)

Oragbug: 24749203
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
Reviewed-by: John Haxby <john.haxby@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
net/netfilter/nf_tables_api.c