All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] netfilter: nf_tables: nft_set_rbtree: fix spurious insertion failure
@ 2026-04-10 10:35 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2026-04-10 10:35 UTC (permalink / raw)
  To: Florian Westphal; +Cc: netfilter-devel

Hello Florian Westphal,

Commit 087388278e0f ("netfilter: nf_tables: nft_set_rbtree: fix
spurious insertion failure") from Sep 28, 2023 (linux-next), leads to
the following Smatch static checker warning:

	net/netfilter/nft_set_rbtree.c:399 __nft_rbtree_insert()
	warn: 'removed_end' is not an error pointer

net/netfilter/nft_set_rbtree.c
    379         /* Detect overlap by going through the list of valid tree nodes.
    380          * Values stored in the tree are in reversed order, starting from
    381          * highest to lowest value.
    382          */
    383         for (node = first; node != NULL; node = next) {
    384                 next = rb_next(node);
    385 
    386                 rbe = rb_entry(node, struct nft_rbtree_elem, node);
    387 
    388                 if (!nft_set_elem_active(&rbe->ext, genmask))
    389                         continue;
    390 
    391                 /* perform garbage collection to avoid bogus overlap reports
    392                  * but skip new elements in this transaction.
    393                  */
    394                 if (__nft_set_elem_expired(&rbe->ext, tstamp) &&
    395                     nft_set_elem_active(&rbe->ext, cur_genmask)) {
    396                         const struct nft_rbtree_elem *removed_end;
    397 
    398                         removed_end = nft_rbtree_gc_elem(set, priv, rbe);
--> 399                         if (IS_ERR(removed_end))
    400                                 return PTR_ERR(removed_end);

nft_rbtree_gc_elem() returns NULL, not error pointers.

    401 
    402                         if (removed_end == rbe_le || removed_end == rbe_ge)
    403                                 return -EAGAIN;
    404 
    405                         continue;
    406                 }

This email is a free service from the Smatch-CI project [smatch.sf.net].

regards,
dan carpenter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-04-10 10:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-10 10:35 [bug report] netfilter: nf_tables: nft_set_rbtree: fix spurious insertion failure Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.