netfilter: nft_set_rbtree: .deactivate fails if element has expired
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 17 Oct 2023 10:28:27 +0000 (12:28 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Oct 2023 10:03:07 +0000 (12:03 +0200)
commit0697918ec0c0cd3da84b76bb1106d57f6f58c378
tree774fb67c0f29e488b72e2ea5c4a6a8d4320a7ef7
parentd9d289b78c5116151724ceebf1eeaa7c2e3cc019
netfilter: nft_set_rbtree: .deactivate fails if element has expired

commit d111692a59c1470ae530cbb39bcf0346c950ecc7 upstream.

This allows to remove an expired element which is not possible in other
existing set backends, this is more noticeable if gc-interval is high so
expired elements remain in the tree. On-demand gc also does not help in
this case, because this is delete element path. Return NULL if element
has expired.

Fixes: 8d8540c4f5e0 ("netfilter: nft_set_rbtree: add timeout support")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/netfilter/nft_set_rbtree.c