From: kernel test robot <lkp@intel.com>
To: Florian Westphal <fw@strlen.de>
Cc: oe-kbuild-all@lists.linux.dev, Pablo Neira Ayuso <pablo@netfilter.org>
Subject: [netfilter-nf-next:for-netdev-nf-next-26-06-14 3/11] net/netfilter/nf_conncount.c:502:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
Date: Mon, 15 Jun 2026 06:26:57 +0800 [thread overview]
Message-ID: <202606150616.cpmJToWO-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next.git for-netdev-nf-next-26-06-14
head: 2354e975932dabb06fad239f07a3b68fd1809737
commit: 64d7d5abe2160bba369b4a8f06bdf5630573bab0 [3/11] netfilter: nf_conncount: callers must hold rcu read lock
config: x86_64-randconfig-123-20260614 (https://download.01.org/0day-ci/archive/20260615/202606150616.cpmJToWO-lkp@intel.com/config)
compiler: gcc-13 (Debian 13.3.0-16) 13.3.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260615/202606150616.cpmJToWO-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202606150616.cpmJToWO-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> net/netfilter/nf_conncount.c:502:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
net/netfilter/nf_conncount.c:502:18: sparse: struct rb_node [noderef] __rcu *
net/netfilter/nf_conncount.c:502:18: sparse: struct rb_node *
net/netfilter/nf_conncount.c:510:34: sparse: sparse: incompatible types in comparison expression (different address spaces):
net/netfilter/nf_conncount.c:510:34: sparse: struct rb_node [noderef] __rcu *
net/netfilter/nf_conncount.c:510:34: sparse: struct rb_node *
net/netfilter/nf_conncount.c:512:34: sparse: sparse: incompatible types in comparison expression (different address spaces):
net/netfilter/nf_conncount.c:512:34: sparse: struct rb_node [noderef] __rcu *
net/netfilter/nf_conncount.c:512:34: sparse: struct rb_node *
net/netfilter/nf_conncount.c: note: in included file (through include/linux/mm_types.h, include/linux/uio.h, include/linux/socket.h, include/uapi/linux/in.h, ...):
include/linux/rbtree.h:107:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
include/linux/rbtree.h:107:9: sparse: struct rb_node [noderef] __rcu *
include/linux/rbtree.h:107:9: sparse: struct rb_node *
vim +502 net/netfilter/nf_conncount.c
486
487 static unsigned int
488 count_tree(struct net *net,
489 const struct sk_buff *skb,
490 u16 l3num,
491 struct nf_conncount_data *data,
492 const u32 *key)
493 {
494 struct rb_root *root;
495 struct rb_node *parent;
496 struct nf_conncount_rb *rbconn;
497 unsigned int hash;
498
499 hash = jhash2(key, data->keylen, data->initval) % CONNCOUNT_SLOTS;
500 root = &data->root[hash];
501
> 502 parent = rcu_dereference(root->rb_node);
503 while (parent) {
504 int diff;
505
506 rbconn = rb_entry(parent, struct nf_conncount_rb, node);
507
508 diff = key_diff(key, rbconn->key, data->keylen);
509 if (diff < 0) {
510 parent = rcu_dereference(parent->rb_left);
511 } else if (diff > 0) {
512 parent = rcu_dereference(parent->rb_right);
513 } else {
514 int ret;
515
516 if (!skb) {
517 nf_conncount_gc_list(net, &rbconn->list);
518 return rbconn->list.count;
519 }
520
521 spin_lock_bh(&rbconn->list.list_lock);
522 /* Node might be about to be free'd.
523 * We need to defer to insert_tree() in this case.
524 */
525 if (rbconn->list.count == 0) {
526 spin_unlock_bh(&rbconn->list.list_lock);
527 break;
528 }
529
530 /* same source network -> be counted! */
531 ret = __nf_conncount_add(net, skb, l3num, &rbconn->list);
532 spin_unlock_bh(&rbconn->list.list_lock);
533 if (ret && ret != -EEXIST) {
534 return 0; /* hotdrop */
535 } else {
536 /* -EEXIST means add was skipped, update the list */
537 if (ret == -EEXIST)
538 nf_conncount_gc_list(net, &rbconn->list);
539 return rbconn->list.count;
540 }
541 }
542 }
543
544 if (!skb)
545 return 0;
546
547 return insert_tree(net, skb, l3num, data, root, hash, key);
548 }
549
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2026-06-14 22:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-14 22:26 kernel test robot [this message]
2026-06-15 0:38 ` [netfilter-nf-next:for-netdev-nf-next-26-06-14 3/11] net/netfilter/nf_conncount.c:502:18: sparse: sparse: incompatible types in comparison expression (different address spaces): Florian Westphal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202606150616.cpmJToWO-lkp@intel.com \
--to=lkp@intel.com \
--cc=fw@strlen.de \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=pablo@netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.