All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "André Almeida" <andrealmeid@igalia.com>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Darren Hart" <dvhart@infradead.org>,
	"Davidlohr Bueso" <dave@stgolabs.net>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Sebastian Andrzej Siewior" <bigeasy@linutronix.de>,
	"Waiman Long" <longman@redhat.com>,
	"Ryan Houdek" <Sonicadvance1@gmail.com>,
	"Thomas Gleixner" <tglx@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-api@vger.kernel.org, kernel-dev@igalia.com,
	"André Almeida" <andrealmeid@igalia.com>
Subject: Re: [PATCH v8 10/10] futex: Use new robust list API internally
Date: Mon, 16 Nov 2026 04:44:19 +0800	[thread overview]
Message-ID: <202611160419.vIdH20Tu-lkp@intel.com> (raw)
In-Reply-To: <20261115-tonyk-robust_futex-v8-10-a4fe47333a28@igalia.com>

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@intel.com/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@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/202611160419.vIdH20Tu-lkp@intel.com/

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

      reply	other threads:[~2026-11-15 20:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-15 17:31 [PATCH v8 00/10] futex: Create {set,get}_robust_list2() syscalls André Almeida
2026-11-15 17:31 ` [PATCH v8 01/10] futex: Skip test_futex_robust_unlock() if not supported André Almeida
2026-11-15 17:31 ` [PATCH v8 02/10] futex: Use explicit sizes for compat_robust_list structs André Almeida
2026-11-15 17:31 ` [PATCH v8 03/10] futex: Make exit_robust_list32() unconditionally available for 64-bit kernels André Almeida
2026-11-15 17:31 ` [PATCH v8 04/10] futex: Create set_robust_list2() syscall André Almeida
2026-11-15 17:31 ` [PATCH v8 05/10] futex: Create get_robust_list2() syscall André Almeida
2026-11-15 17:31 ` [PATCH v8 06/10] futex: Wire up set_robust_list2 syscall André Almeida
2026-11-15 20:55   ` kernel test robot
2026-11-15 21:30   ` kernel test robot
2026-11-15 17:31 ` [PATCH v8 07/10] futex: Wire up get_robust_list2 syscall André Almeida
2026-11-15 17:31 ` [PATCH v8 08/10] selftests/futex: Expand for set_robust_list2() André Almeida
2026-11-15 17:31 ` [PATCH v8 09/10] selftests/futex: Expand for get_robust_list2() André Almeida
2026-11-15 17:31 ` [PATCH v8 10/10] futex: Use new robust list API internally André Almeida
2026-11-15 20:44   ` kernel test robot [this message]

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=202611160419.vIdH20Tu-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=Sonicadvance1@gmail.com \
    --cc=andrealmeid@igalia.com \
    --cc=arnd@arndb.de \
    --cc=bigeasy@linutronix.de \
    --cc=dave@stgolabs.net \
    --cc=dvhart@infradead.org \
    --cc=kernel-dev@igalia.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=longman@redhat.com \
    --cc=mingo@redhat.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=peterz@infradead.org \
    --cc=tglx@kernel.org \
    /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.