netfilter: nf_tables: bogus EBUSY when deleting set after flush
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 8 Mar 2019 14:30:03 +0000 (15:30 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 May 2019 07:58:51 +0000 (09:58 +0200)
commite313d5da057b2335b6f60aa70e9873a4f0f59d45
treea4f547cc97a6596747ee3c0bf6cb624feea899f7
parent25ddad73070c8fd15528fe804db90f0bda0dc6ad
netfilter: nf_tables: bogus EBUSY when deleting set after flush

[ Upstream commit 273fe3f1006ea5ebc63d6729e43e8e45e32b256a ]

Set deletion after flush coming in the same batch results in EBUSY. Add
set use counter to track the number of references to this set from
rules. We cannot rely on the list of bindings for this since such list
is still populated from the preparation phase.

Reported-by: Václav Zindulka <vaclav.zindulka@tlapnet.cz>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/net/netfilter/nf_tables.h
net/netfilter/nf_tables_api.c
net/netfilter/nft_dynset.c
net/netfilter/nft_lookup.c
net/netfilter/nft_objref.c