kernel/events/uprobes.c:2038:17: sparse: sparse: incompatible types in comparison expression (different address spaces):
From: kernel test robot
Date: Sun Feb 15 2026 - 20:23:27 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 26a4cfaff82a2dcb810f6bfd5f4842f9b6046c8a
commit: dd1a7567784e2b1f80258be04f57bcfa82c997eb uprobes: SRCU-protect uretprobe lifetime (with timeout)
date: 1 year, 4 months ago
config: x86_64-randconfig-121-20260216 (https://download.01.org/0day-ci/archive/20260216/202602160931.CnnMtX4E-lkp@xxxxxxxxx/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260216/202602160931.CnnMtX4E-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202602160931.CnnMtX4E-lkp@xxxxxxxxx/
sparse warnings: (new ones prefixed by >>)
>> kernel/events/uprobes.c:2038:17: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/events/uprobes.c:2038:17: sparse: struct return_instance [noderef] __rcu *
kernel/events/uprobes.c:2038:17: sparse: struct return_instance *
kernel/events/uprobes.c:2119:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/events/uprobes.c:2119:9: sparse: struct return_instance [noderef] __rcu *
kernel/events/uprobes.c:2119:9: sparse: struct return_instance *
kernel/events/uprobes.c:2178:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/events/uprobes.c:2178:9: sparse: struct return_instance [noderef] __rcu *
kernel/events/uprobes.c:2178:9: sparse: struct return_instance *
kernel/events/uprobes.c:2237:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/events/uprobes.c:2239:35: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/events/uprobes.c:2498:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/events/uprobes.c:2498:25: sparse: struct return_instance [noderef] __rcu *
kernel/events/uprobes.c:2498:25: sparse: struct return_instance *
kernel/events/uprobes.c:2626:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/events/uprobes.c:2628:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/events/uprobes.c: note: in included file (through include/linux/rculist.h, include/linux/dcache.h, include/linux/fs.h, ...):
include/linux/rcupdate.h:880:25: sparse: sparse: context imbalance in '__replace_page' - unexpected unlock
kernel/events/uprobes.c:730:17: sparse: sparse: context imbalance in 'hprobe_finalize' - unexpected unlock
kernel/events/uprobes.c:798:25: sparse: sparse: context imbalance in 'hprobe_expire' - unexpected unlock
kernel/events/uprobes.c: note: in included file (through include/linux/mm_types.h, include/linux/mmzone.h, include/linux/gfp.h, ...):
include/linux/rbtree.h:74:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
include/linux/rbtree.h:74:9: sparse: struct rb_node [noderef] __rcu *
include/linux/rbtree.h:74:9: sparse: struct rb_node *
vim +2038 kernel/events/uprobes.c
2005
2006 static int dup_utask(struct task_struct *t, struct uprobe_task *o_utask)
2007 {
2008 struct uprobe_task *n_utask;
2009 struct return_instance **p, *o, *n;
2010 struct uprobe *uprobe;
2011
2012 n_utask = alloc_utask();
2013 if (!n_utask)
2014 return -ENOMEM;
2015 t->utask = n_utask;
2016
2017 /* protect uprobes from freeing, we'll need try_get_uprobe() them */
2018 guard(srcu)(&uretprobes_srcu);
2019
2020 p = &n_utask->return_instances;
2021 for (o = o_utask->return_instances; o; o = o->next) {
2022 n = dup_return_instance(o);
2023 if (!n)
2024 return -ENOMEM;
2025
2026 /* if uprobe is non-NULL, we'll have an extra refcount for uprobe */
2027 uprobe = hprobe_expire(&o->hprobe, true);
2028
2029 /*
2030 * New utask will have stable properly refcounted uprobe or
2031 * NULL. Even if we failed to get refcounted uprobe, we still
2032 * need to preserve full set of return_instances for proper
2033 * uretprobe handling and nesting in forked task.
2034 */
2035 hprobe_init_stable(&n->hprobe, uprobe);
2036
2037 n->next = NULL;
> 2038 rcu_assign_pointer(*p, n);
2039 p = &n->next;
2040
2041 n_utask->depth++;
2042 }
2043
2044 return 0;
2045 }
2046
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki