This is a note to let you know that I've just added the patch titled netfilter: nft_set_rbtree: skip end interval element from gc to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: netfilter-nft_set_rbtree-skip-end-interval-element-from-gc.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 60c0c230c6f046da536d3df8b39a20b9a9fd6af0 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> Date: Wed, 7 Feb 2024 18:49:51 +0100 Subject: netfilter: nft_set_rbtree: skip end interval element from gc From: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> commit 60c0c230c6f046da536d3df8b39a20b9a9fd6af0 upstream. rbtree lazy gc on insert might collect an end interval element that has been just added in this transactions, skip end interval elements that are not yet active. Fixes: f718863aca46 ("netfilter: nft_set_rbtree: fix overlap expiration walk") Cc: stable@xxxxxxxxxxxxxxx Reported-by: lonial con <kongln9170@xxxxxxxxx> Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- net/netfilter/nft_set_rbtree.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/net/netfilter/nft_set_rbtree.c +++ b/net/netfilter/nft_set_rbtree.c @@ -235,7 +235,7 @@ static void nft_rbtree_gc_remove(struct static const struct nft_rbtree_elem * nft_rbtree_gc_elem(const struct nft_set *__set, struct nft_rbtree *priv, - struct nft_rbtree_elem *rbe, u8 genmask) + struct nft_rbtree_elem *rbe) { struct nft_set *set = (struct nft_set *)__set; struct rb_node *prev = rb_prev(&rbe->node); @@ -254,7 +254,7 @@ nft_rbtree_gc_elem(const struct nft_set while (prev) { rbe_prev = rb_entry(prev, struct nft_rbtree_elem, node); if (nft_rbtree_interval_end(rbe_prev) && - nft_set_elem_active(&rbe_prev->ext, genmask)) + nft_set_elem_active(&rbe_prev->ext, NFT_GENMASK_ANY)) break; prev = rb_prev(prev); @@ -365,7 +365,7 @@ static int __nft_rbtree_insert(const str nft_set_elem_active(&rbe->ext, cur_genmask)) { const struct nft_rbtree_elem *removed_end; - removed_end = nft_rbtree_gc_elem(set, priv, rbe, genmask); + removed_end = nft_rbtree_gc_elem(set, priv, rbe); if (IS_ERR(removed_end)) return PTR_ERR(removed_end); Patches currently in stable-queue which might be from pablo@xxxxxxxxxxxxx are queue-5.15/netfilter-nft_ct-sanitize-layer-3-and-4-protocol-num.patch queue-5.15/netfilter-nf_tables-validate-nfproto_-family.patch queue-5.15/netfilter-nft_set_rbtree-skip-end-interval-element-from-gc.patch queue-5.15/netfilter-nft_limit-reject-configurations-that-cause.patch queue-5.15/netfilter-nf_log-replace-bug_on-by-warn_on_once-when.patch queue-5.15/netfilter-nf_tables-restrict-tunnel-object-to-nfprot.patch queue-5.15/netfilter-nf_tables-restrict-anonymous-set-and-map-n.patch queue-5.15/netfilter-nft_ct-reject-direction-for-ct-id.patch queue-5.15/netfilter-nft_chain_filter-handle-netdev_unregister-for-inet-ingress-basechain.patch queue-5.15/netfilter-nft_set_pipapo-remove-scratch_aligned-poin.patch queue-5.15/netfilter-nf_tables-reject-queue-drop-verdict-parameters.patch queue-5.15/netfilter-nft_compat-restrict-match-target-protocol-.patch queue-5.15/netfilter-nft_compat-reject-unused-compat-flag.patch queue-5.15/netfilter-nft_set_pipapo-store-index-in-scratch-maps.patch queue-5.15/netfilter-nft_set_pipapo-add-helper-to-release-pcpu-.patch