Re: [PATCH v8 10/10] futex: Use new robust list API internally

From: kernel test robot

Date: Sun Nov 15 2026 - 15:45:05 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-10-a4fe47333a28%40igalia.com
patch subject: [PATCH v8 10/10] futex: Use new robust list API internally
config: x86_64-allnoconfig (https://download.01.org/0day-ci/archive/20261116/202611160419.vIdH20Tu-lkp@xxxxxxxxx/config)
compiler: clang version 22.1.8 (https://github.com/llvm/llvm-project ca7933e47d3a3451d81e72ac174dcb5aa28b59d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261116/202611160419.vIdH20Tu-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/202611160419.vIdH20Tu-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> kernel/futex/syscalls.c:75:6: warning: variable 'head' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
75 | if (index >= 0) {
| ^~~~~~~~~~
kernel/futex/syscalls.c:85:9: note: uninitialized use occurs here
85 | return head;
| ^~~~
kernel/futex/syscalls.c:75:2: note: remove the 'if' if its condition is always true
75 | if (index >= 0) {
| ^~~~~~~~~~~~~~~
kernel/futex/syscalls.c:48:19: note: initialize the variable 'head' to silence this warning
48 | void __user *head;
| ^
| = NULL
1 warning generated.


vim +75 kernel/futex/syscalls.c

af8cc9600bbf22 Peter Zijlstra 2021-09-23 44
5588aabbe40841 André Almeida 2026-11-15 45 static void __user *futex_get_robust_list_common(int pid, bool compat, int index)
6b54082c3ed4dc Pranav Tyagi 2025-09-15 46 {
6b54082c3ed4dc Pranav Tyagi 2025-09-15 47 struct task_struct *p = current;
6b54082c3ed4dc Pranav Tyagi 2025-09-15 48 void __user *head;
6b54082c3ed4dc Pranav Tyagi 2025-09-15 49 int ret;
af8cc9600bbf22 Peter Zijlstra 2021-09-23 50
a2d2b7acb53d36 André Almeida 2026-11-15 51 if (index >= FUTEX_ROBUST_LIST2_MAX_IDX)
a2d2b7acb53d36 André Almeida 2026-11-15 52 return (void __user *)ERR_PTR(-EINVAL);
a2d2b7acb53d36 André Almeida 2026-11-15 53
6b54082c3ed4dc Pranav Tyagi 2025-09-15 54 scoped_guard(rcu) {
6b54082c3ed4dc Pranav Tyagi 2025-09-15 55 if (pid) {
af8cc9600bbf22 Peter Zijlstra 2021-09-23 56 p = find_task_by_vpid(pid);
af8cc9600bbf22 Peter Zijlstra 2021-09-23 57 if (!p)
6b54082c3ed4dc Pranav Tyagi 2025-09-15 58 return (void __user *)ERR_PTR(-ESRCH);
6b54082c3ed4dc Pranav Tyagi 2025-09-15 59 }
6b54082c3ed4dc Pranav Tyagi 2025-09-15 60 get_task_struct(p);
af8cc9600bbf22 Peter Zijlstra 2021-09-23 61 }
af8cc9600bbf22 Peter Zijlstra 2021-09-23 62
6b54082c3ed4dc Pranav Tyagi 2025-09-15 63 /*
6b54082c3ed4dc Pranav Tyagi 2025-09-15 64 * Hold exec_update_lock to serialize with concurrent exec()
6b54082c3ed4dc Pranav Tyagi 2025-09-15 65 * so ptrace_may_access() is checked against stable credentials
6b54082c3ed4dc Pranav Tyagi 2025-09-15 66 */
6b54082c3ed4dc Pranav Tyagi 2025-09-15 67 ret = down_read_killable(&p->signal->exec_update_lock);
6b54082c3ed4dc Pranav Tyagi 2025-09-15 68 if (ret)
6b54082c3ed4dc Pranav Tyagi 2025-09-15 69 goto err_put;
6b54082c3ed4dc Pranav Tyagi 2025-09-15 70
af8cc9600bbf22 Peter Zijlstra 2021-09-23 71 ret = -EPERM;
af8cc9600bbf22 Peter Zijlstra 2021-09-23 72 if (!ptrace_may_access(p, PTRACE_MODE_READ_REALCREDS))
af8cc9600bbf22 Peter Zijlstra 2021-09-23 73 goto err_unlock;
af8cc9600bbf22 Peter Zijlstra 2021-09-23 74
5588aabbe40841 André Almeida 2026-11-15 @75 if (index >= 0) {
5588aabbe40841 André Almeida 2026-11-15 76 scoped_guard(mutex, &p->futex.exit_mutex) {
5588aabbe40841 André Almeida 2026-11-15 77 uintptr_t *rl = p->futex.robust_lists;
5588aabbe40841 André Almeida 2026-11-15 78 head = rl ? (void __user *) rl[index] : NULL;
5588aabbe40841 André Almeida 2026-11-15 79 }
5588aabbe40841 André Almeida 2026-11-15 80 }
af8cc9600bbf22 Peter Zijlstra 2021-09-23 81
6b54082c3ed4dc Pranav Tyagi 2025-09-15 82 up_read(&p->signal->exec_update_lock);
6b54082c3ed4dc Pranav Tyagi 2025-09-15 83 put_task_struct(p);
6b54082c3ed4dc Pranav Tyagi 2025-09-15 84
6b54082c3ed4dc Pranav Tyagi 2025-09-15 85 return head;
af8cc9600bbf22 Peter Zijlstra 2021-09-23 86
af8cc9600bbf22 Peter Zijlstra 2021-09-23 87 err_unlock:
6b54082c3ed4dc Pranav Tyagi 2025-09-15 88 up_read(&p->signal->exec_update_lock);
6b54082c3ed4dc Pranav Tyagi 2025-09-15 89 err_put:
6b54082c3ed4dc Pranav Tyagi 2025-09-15 90 put_task_struct(p);
6b54082c3ed4dc Pranav Tyagi 2025-09-15 91 return (void __user *)ERR_PTR(ret);
6b54082c3ed4dc Pranav Tyagi 2025-09-15 92 }
af8cc9600bbf22 Peter Zijlstra 2021-09-23 93

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