]> git.hungrycats.org Git - linux/commit
netfilter: nf_tables: fix addition/deletion of elements from commit/abort
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 20 Feb 2015 16:11:10 +0000 (17:11 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Mar 2015 12:59:49 +0000 (13:59 +0100)
commit8f246228ca057df31225216063e198b25cea7a59
tree75aeb6409a4dcd9ac458b560287ce4eae7c561a2
parent0a12e44c18d25ba0b796cc49610430cbfd4676ec
netfilter: nf_tables: fix addition/deletion of elements from commit/abort

commit 02263db00b6cb98701332aa257c07ca549c2324b upstream.

We have several problems in this path:

1) There is a use-after-free when removing individual elements from
   the commit path.

2) We have to uninit() the data part of the element from the abort
   path to avoid a chain refcount leak.

3) We have to check for set->flags to see if there's a mapping, instead
   of the element flags.

4) We have to check for !(flags & NFT_SET_ELEM_INTERVAL_END) to skip
   elements that are part of the interval that have no data part, so
   they don't need to be uninit().

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/netfilter/nf_tables_api.c