From: kernel test robot <lkp@intel.com>
To: " André Almeida" <andrealmeid@igalia.com>
Cc: oe-kbuild-all@lists.linux.dev, 0day robot <lkp@intel.com>
Subject: kernel/futex/syscalls.c:204:22: sparse: sparse: incorrect type in assignment (different address spaces)
Date: Wed, 30 Sep 2026 15:30:29 +0200 [thread overview]
Message-ID: <202609301514.dUuYTMaT-lkp@intel.com> (raw)
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
reply other threads:[~2026-09-30 13:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202609301514.dUuYTMaT-lkp@intel.com \
--to=lkp@intel.com \
--cc=andrealmeid@igalia.com \
--cc=oe-kbuild-all@lists.linux.dev \
/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.