UPSTREAM: netfilter: nft_set_rbtree: fix overlap expiration walk
commit f718863aca469a109895cb855e6b81fff4827d71 upstream.
The lazy gc on insert that should remove timed-out entries fails to release
the other half of the interval, if any.
Can be reproduced with tests/shell/testcases/sets/0044interval_overlap_0
in nftables.git and kmemleak enabled kernel.
Second bug is the use of rbe_prev vs. prev pointer.
If rbe_prev() returns NULL after at least one iteration, rbe_prev points
to element that is not an end interval, hence it should not be removed.
Lastly, check the genmask of the end interval if this is active in the
current generation.
Bug: 299922216
Fixes: c9e6978e2725 ("netfilter: nft_set_rbtree: Switch to node list walk for overlap detection")
Signed-off-by:
Florian Westphal <fw@strlen.de>
Signed-off-by:
Sasha Levin <sashal@kernel.org>
Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit acaee227)
Signed-off-by:
Lee Jones <joneslee@google.com>
Change-Id: I0c46b46ba4e0811b37dc4e332e97c157c5d452bb
Loading
Please register or sign in to comment