netfilter: nft_set_hash: bogus element self comparison from deactivation path
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 25 Feb 2019 13:13:42 +0000 (14:13 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:50:29 +0000 (14:50 +0100)
commitabbfc53d999d20299906903d71c6607158f9c814
tree9b96d5a3b51e062c370416337924075a7f479866
parent9eebb677099e280669262e651d48cffd788ffb84
netfilter: nft_set_hash: bogus element self comparison from deactivation path

[ Upstream commit a01cbae57ec29b161d42ee1caa4ffffda5d519c2 ]

Use the element from the loop iteration, not the same element we want to
deactivate otherwise this branch always evaluates true.

Fixes: 6c03ae210ce3 ("netfilter: nft_set_hash: add non-resizable hashtable implementation")
Reported-by: Florian Westphal <fw@strlen.de>
Tested-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nft_set_hash.c