From: kernel test robot <lkp@intel.com>
To: Pranav Tyagi <pranav.tyagi03@gmail.com>,
tglx@linutronix.de, mingo@redhat.com, peterz@infradead.org,
dvhart@infradead.org, dave@stgolabs.net, andrealmeid@igalia.com,
linux-kernel@vger.kernel.org
Cc: oe-kbuild-all@lists.linux.dev, jann@thejh.net,
keescook@chromium.org, skhan@linuxfoundation.org,
linux-kernel-mentees@lists.linux.dev,
Pranav Tyagi <pranav.tyagi03@gmail.com>
Subject: Re: [PATCH v2] futex: don't leak robust_list pointer on exec race
Date: Wed, 6 Aug 2025 02:27:15 +0800 [thread overview]
Message-ID: <202508060225.urZa7B2V-lkp@intel.com> (raw)
In-Reply-To: <20250804115533.14186-1-pranav.tyagi03@gmail.com>
Hi Pranav,
kernel test robot noticed the following build warnings:
[auto build test WARNING on tip/locking/core]
[also build test WARNING on linus/master v6.16 next-20250805]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Pranav-Tyagi/futex-don-t-leak-robust_list-pointer-on-exec-race/20250804-195739
base: tip/locking/core
patch link: https://lore.kernel.org/r/20250804115533.14186-1-pranav.tyagi03%40gmail.com
patch subject: [PATCH v2] futex: don't leak robust_list pointer on exec race
config: x86_64-randconfig-r132-20250805 (https://download.01.org/0day-ci/archive/20250806/202508060225.urZa7B2V-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250806/202508060225.urZa7B2V-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/202508060225.urZa7B2V-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> kernel/futex/syscalls.c:64:39: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected void [noderef] __user * @@ got void * @@
kernel/futex/syscalls.c:64:39: sparse: expected void [noderef] __user *
kernel/futex/syscalls.c:64:39: sparse: got void *
kernel/futex/syscalls.c:94:23: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected void [noderef] __user * @@ got void * @@
kernel/futex/syscalls.c:94:23: sparse: expected void [noderef] __user *
kernel/futex/syscalls.c:94:23: sparse: got void *
vim +64 kernel/futex/syscalls.c
41
42 static void __user *get_robust_list_common(int pid,
43 bool compat)
44 {
45 void __user *head;
46 unsigned long ret;
47
48 struct task_struct *p;
49
50 if (!pid) {
51 p = current;
52 get_task_struct(p);
53 } else {
54 rcu_read_lock();
55 p = find_task_by_vpid(pid);
56 /*
57 * pin the task to permit dropping the RCU read lock before
58 * acquiring the semaphore
59 */
60 if (p)
61 get_task_struct(p);
62 rcu_read_unlock();
63 if (!p)
> 64 return ERR_PTR(-ESRCH);
65 }
66
67 /*
68 * Hold exec_update_lock to serialize with concurrent exec()
69 * so ptrace_may_access() is checked against stable credentials
70 */
71
72 ret = down_read_killable(&p->signal->exec_update_lock);
73 if (ret)
74 goto err_put;
75
76 ret = -EPERM;
77 if (!ptrace_may_access(p, PTRACE_MODE_READ_REALCREDS))
78 goto err_unlock;
79
80 if (compat)
81 head = p->compat_robust_list;
82 else
83 head = p->robust_list;
84
85 up_read(&p->signal->exec_update_lock);
86 put_task_struct(p);
87
88 return head;
89
90 err_unlock:
91 up_read(&p->signal->exec_update_lock);
92 err_put:
93 put_task_struct(p);
94 return ERR_PTR(ret);
95 }
96
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
prev parent reply other threads:[~2025-08-05 18:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-04 11:55 [PATCH v2] futex: don't leak robust_list pointer on exec race Pranav Tyagi
2025-08-04 15:12 ` Kees Cook
2025-08-05 8:19 ` Thomas Gleixner
2025-08-05 13:57 ` Pranav Tyagi
2025-08-05 9:01 ` kernel test robot
2025-08-05 18:27 ` 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=202508060225.urZa7B2V-lkp@intel.com \
--to=lkp@intel.com \
--cc=andrealmeid@igalia.com \
--cc=dave@stgolabs.net \
--cc=dvhart@infradead.org \
--cc=jann@thejh.net \
--cc=keescook@chromium.org \
--cc=linux-kernel-mentees@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=peterz@infradead.org \
--cc=pranav.tyagi03@gmail.com \
--cc=skhan@linuxfoundation.org \
--cc=tglx@linutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox