All of lore.kernel.org
 help / color / mirror / Atom feed
* kernel/futex/syscalls.c:204:22: sparse: sparse: incorrect type in assignment (different address spaces)
@ 2026-09-30 13:30 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-09-30 13:30 UTC (permalink / raw)
  To:  André Almeida; +Cc: oe-kbuild-all, 0day robot

tree:   https://github.com/intel-lab-lkp/linux/commits/Andr-Almeida/futex-Skip-test_futex_robust_unlock-if-not-supported/20260925-145324
head:   0a151b703cae864a3bab66cc7fb5b8dc983658d3
commit: 8e4b5fd01bb4f8850e3f022e267d4fc53678c8fe futex: Create get_robust_list2() syscall
date:   5 days ago
config: m68k-randconfig-r2300-20260930 (https://download.01.org/0day-ci/archive/20260930/202609301514.dUuYTMaT-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 12.5.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260930/202609301514.dUuYTMaT-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/202609301514.dUuYTMaT-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> kernel/futex/syscalls.c:204:22: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct robust_list_head *head @@     got struct robust_list_head [noderef] __user * @@
   kernel/futex/syscalls.c:204:22: sparse:     expected struct robust_list_head *head
   kernel/futex/syscalls.c:204:22: sparse:     got struct robust_list_head [noderef] __user *
>> kernel/futex/syscalls.c:206:24: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void [noderef] __user *__x @@     got struct robust_list_head *head @@
   kernel/futex/syscalls.c:206:24: sparse:     expected void [noderef] __user *__x
   kernel/futex/syscalls.c:206:24: sparse:     got struct robust_list_head *head

vim +204 kernel/futex/syscalls.c

   164	
   165	SYSCALL_DEFINE4(get_robust_list2, int, pid,
   166			void __user * __user *, head_ptr,
   167			unsigned int, index, unsigned int, flags)
   168	{
   169		void __user *entry_ptr;
   170		uintptr_t entry;
   171	
   172		if (index >= FUTEX_ROBUST_LISTS_PER_USER)
   173			return -EINVAL;
   174	
   175		if (flags)
   176			return -EINVAL;
   177	
   178		/*
   179		 * The first two indexes are reserved for the kernel to be used with the
   180		 * legacy syscall, so we hide them from userspace.
   181		 *
   182		 * We map [0, FUTEX_ROBUST_LISTS_PER_USER) to
   183		 *  [FUTEX_ROBUST_LIST2_IDX, FUTEX_ROBUST_LIST2_MAX_IDX)
   184		 */
   185		index += FUTEX_ROBUST_LIST2_IDX;
   186	
   187		entry_ptr = futex_get_robust_list_common(pid, false, index);
   188		if (IS_ERR(entry_ptr))
   189			return PTR_ERR(entry_ptr);
   190	
   191		entry = (uintptr_t) entry_ptr;
   192	
   193		if (entry & FUTEX_ROBUST_LIST_ENTRY_32BIT) {
   194			entry &= FUTEX_ROBUST_LIST_ENTRY_MASK;
   195	
   196			if (copy_to_user(head_ptr, &entry, sizeof(u32)))
   197				return -EFAULT;
   198	
   199			return 0;
   200		} else {
   201			struct robust_list_head *head;
   202	
   203			entry &= FUTEX_ROBUST_LIST_ENTRY_MASK;
 > 204			head = (__force struct robust_list_head __user *)entry;
   205	
 > 206			return put_user(head, head_ptr);
   207		}
   208	}
   209	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

only message in thread, other threads:[~2026-09-30 13:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-30 13:30 kernel/futex/syscalls.c:204:22: sparse: sparse: incorrect type in assignment (different address spaces) kernel test robot

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.