]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_tables: don't allow to rename to already-pending name
authorFlorian Westphal <fw@strlen.de>
Tue, 17 Jul 2018 05:17:56 +0000 (07:17 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 20 Jul 2018 13:31:44 +0000 (15:31 +0200)
commit94767701cb76e815d0c8cf6530083c016b68b351
tree0c7c3a3de8183ffcb6b8c11718076a0a428fc5a8
parent3d13facecf22a37f13fb6b9c671645fd840aef87
netfilter: nf_tables: don't allow to rename to already-pending name

Its possible to rename two chains to the same name in one
transaction:

nft add chain t c1
nft add chain t c2
nft 'rename chain t c1 c3;rename chain t c2 c3'

This creates two chains named 'c3'.

Appears to be harmless, both chains can still be deleted both
by name or handle, but, nevertheless, its a bug.

Walk transaction log and also compare vs. the pending renames.

Both chains can still be deleted, but nevertheless it is a bug as
we don't allow to create chains with identical names, so we should
prevent this from happening-by-rename too.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_api.c