[Devel] [PATCH RH7 3/4] ms/netfilter: nft_set_rbtree: check for inactive element after flag mismatch
Vasily Averin
vvs at virtuozzo.com
Fri Dec 18 13:25:21 MSK 2020
From: Pablo Neira Ayuso <pablo at netfilter.org>
Otherwise, we hit bogus ENOENT when removing elements.
Fixes: e701001e7cbe ("netfilter: nft_rbtree: allow adjacent intervals with dynamic updates")
Reported-by: Václav Zindulka <vaclav.zindulka at tlapnet.cz>
Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
(cherry-picked from commit 05b7639da55f5555b9866a1f4b7e8995232a6323)
VvS: minor context changes
https://jira.sw.ru/browse/PSBM-121318
Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
---
net/netfilter/nft_rbtree.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/net/netfilter/nft_rbtree.c b/net/netfilter/nft_rbtree.c
index f9cfcf7..ab95e57 100644
--- a/net/netfilter/nft_rbtree.c
+++ b/net/netfilter/nft_rbtree.c
@@ -194,10 +194,6 @@ static void *nft_rbtree_deactivate(const struct nft_set *set,
else if (d > 0)
parent = parent->rb_right;
else {
- if (!nft_set_elem_active(&rbe->ext, genmask)) {
- parent = parent->rb_left;
- continue;
- }
if (nft_rbtree_interval_end(rbe) &&
!nft_rbtree_interval_end(this)) {
parent = parent->rb_left;
@@ -206,6 +202,9 @@ static void *nft_rbtree_deactivate(const struct nft_set *set,
nft_rbtree_interval_end(this)) {
parent = parent->rb_right;
continue;
+ } else if (!nft_set_elem_active(&rbe->ext, genmask)) {
+ parent = parent->rb_left;
+ continue;
}
nft_rbtree_deactivate_one(set, rbe);
return rbe;
--
1.8.3.1
More information about the Devel
mailing list