Re: [PATCH v8 05/10] futex: Create get_robust_list2() syscall

From: kernel test robot

Date: Fri Nov 20 2026 - 19:36:16 EST


Hi André,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 9f74092fda91ef93c2b07585785c1dc83cd7971f]

url: https://github.com/intel-lab-lkp/linux/commits/Andr-Almeida/futex-Skip-test_futex_robust_unlock-if-not-supported/20261115-143110
base: 9f74092fda91ef93c2b07585785c1dc83cd7971f
patch link: https://lore.kernel.org/r/20261115-tonyk-robust_futex-v8-5-a4fe47333a28%40igalia.com
patch subject: [PATCH v8 05/10] futex: Create get_robust_list2() syscall
config: arm64-randconfig-r2300-20261120 (https://download.01.org/0day-ci/archive/20261121/20261121013133.eLi73Mpq-lkp@xxxxxxxxx/config)
compiler: aarch64-linux-gcc (GCC) 12.5.0
sparse: v0.6.5-rc1-21-g84ec0658
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261121/20261121013133.eLi73Mpq-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/20261121013133.eLi73Mpq-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
kernel/futex/syscalls.c:119:46: sparse: sparse: dereference of noderef expression
kernel/futex/syscalls.c:216:14: 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:216:14: sparse: expected struct robust_list_head *head
kernel/futex/syscalls.c:216:14: sparse: got struct robust_list_head [noderef] __user *
>> kernel/futex/syscalls.c:218:16: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void [noderef] __user *__rpu_val @@ got struct robust_list_head *head @@
kernel/futex/syscalls.c:218:16: sparse: expected void [noderef] __user *__rpu_val
kernel/futex/syscalls.c:218:16: sparse: got struct robust_list_head *head

vim +218 kernel/futex/syscalls.c

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

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