From: kernel test robot <philip.li@intel.com>
To: David Hildenbrand <david@redhat.com>
Cc: <llvm@lists.linux.dev>, <oe-kbuild-all@lists.linux.dev>,
<linux-kernel@vger.kernel.org>
Subject: kernel/fork.c:1181: warning: Function parameter or member 'mm' not described in 'replace_mm_exe_file'
Date: Mon, 4 Sep 2023 08:55:27 +0800 [thread overview]
Message-ID: <ZPUq/wZqDBrUvoLe@rli9-mobl> (raw)
[-- Attachment #1: Type: text/plain, Size: 4946 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 708283abf896dd4853e673cc8cba70acaf9bf4ea
commit: 35d7bdc86031a2c1ae05ac27dfa93b2acdcbaecc kernel/fork: factor out replacing the current MM exe_file
date: 2 years ago
:::::: branch date: 5 hours ago
:::::: commit date: 2 years ago
config: i386-allnoconfig (attached as .config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce (this is a W=1 build): (attached as 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/202309040758.TJlCtQvv-lkp@intel.com/
All warnings (new ones prefixed by >>):
kernel/fork.c:1154: warning: Function parameter or member 'mm' not described in 'set_mm_exe_file'
kernel/fork.c:1154: warning: Function parameter or member 'new_exe_file' not described in 'set_mm_exe_file'
>> kernel/fork.c:1181: warning: Function parameter or member 'mm' not described in 'replace_mm_exe_file'
>> kernel/fork.c:1181: warning: Function parameter or member 'new_exe_file' not described in 'replace_mm_exe_file'
kernel/fork.c:1218: warning: Function parameter or member 'mm' not described in 'get_mm_exe_file'
kernel/fork.c:1238: warning: Function parameter or member 'task' not described in 'get_task_exe_file'
kernel/fork.c:1263: warning: Function parameter or member 'task' not described in 'get_task_mm'
kernel/fork.c:2807: warning: expecting prototype for clone3(). Prototype was for sys_clone3() instead
vim +1181 kernel/fork.c
3864601387cf419 Jiri Slaby 2011-05-26 1170
35d7bdc86031a2c David Hildenbrand 2021-04-23 1171 /**
35d7bdc86031a2c David Hildenbrand 2021-04-23 1172 * replace_mm_exe_file - replace a reference to the mm's executable file
35d7bdc86031a2c David Hildenbrand 2021-04-23 1173 *
35d7bdc86031a2c David Hildenbrand 2021-04-23 1174 * This changes mm's executable file (shown as symlink /proc/[pid]/exe),
35d7bdc86031a2c David Hildenbrand 2021-04-23 1175 * dealing with concurrent invocation and without grabbing the mmap lock in
35d7bdc86031a2c David Hildenbrand 2021-04-23 1176 * write mode.
35d7bdc86031a2c David Hildenbrand 2021-04-23 1177 *
35d7bdc86031a2c David Hildenbrand 2021-04-23 1178 * Main user is sys_prctl(PR_SET_MM_MAP/EXE_FILE).
35d7bdc86031a2c David Hildenbrand 2021-04-23 1179 */
35d7bdc86031a2c David Hildenbrand 2021-04-23 1180 int replace_mm_exe_file(struct mm_struct *mm, struct file *new_exe_file)
35d7bdc86031a2c David Hildenbrand 2021-04-23 @1181 {
35d7bdc86031a2c David Hildenbrand 2021-04-23 1182 struct vm_area_struct *vma;
35d7bdc86031a2c David Hildenbrand 2021-04-23 1183 struct file *old_exe_file;
35d7bdc86031a2c David Hildenbrand 2021-04-23 1184 int ret = 0;
35d7bdc86031a2c David Hildenbrand 2021-04-23 1185
35d7bdc86031a2c David Hildenbrand 2021-04-23 1186 /* Forbid mm->exe_file change if old file still mapped. */
35d7bdc86031a2c David Hildenbrand 2021-04-23 1187 old_exe_file = get_mm_exe_file(mm);
35d7bdc86031a2c David Hildenbrand 2021-04-23 1188 if (old_exe_file) {
35d7bdc86031a2c David Hildenbrand 2021-04-23 1189 mmap_read_lock(mm);
35d7bdc86031a2c David Hildenbrand 2021-04-23 1190 for (vma = mm->mmap; vma && !ret; vma = vma->vm_next) {
35d7bdc86031a2c David Hildenbrand 2021-04-23 1191 if (!vma->vm_file)
35d7bdc86031a2c David Hildenbrand 2021-04-23 1192 continue;
35d7bdc86031a2c David Hildenbrand 2021-04-23 1193 if (path_equal(&vma->vm_file->f_path,
35d7bdc86031a2c David Hildenbrand 2021-04-23 1194 &old_exe_file->f_path))
35d7bdc86031a2c David Hildenbrand 2021-04-23 1195 ret = -EBUSY;
35d7bdc86031a2c David Hildenbrand 2021-04-23 1196 }
35d7bdc86031a2c David Hildenbrand 2021-04-23 1197 mmap_read_unlock(mm);
35d7bdc86031a2c David Hildenbrand 2021-04-23 1198 fput(old_exe_file);
35d7bdc86031a2c David Hildenbrand 2021-04-23 1199 if (ret)
35d7bdc86031a2c David Hildenbrand 2021-04-23 1200 return ret;
35d7bdc86031a2c David Hildenbrand 2021-04-23 1201 }
35d7bdc86031a2c David Hildenbrand 2021-04-23 1202
35d7bdc86031a2c David Hildenbrand 2021-04-23 1203 /* set the new file, lockless */
35d7bdc86031a2c David Hildenbrand 2021-04-23 1204 get_file(new_exe_file);
35d7bdc86031a2c David Hildenbrand 2021-04-23 1205 old_exe_file = xchg(&mm->exe_file, new_exe_file);
35d7bdc86031a2c David Hildenbrand 2021-04-23 1206 if (old_exe_file)
35d7bdc86031a2c David Hildenbrand 2021-04-23 1207 fput(old_exe_file);
35d7bdc86031a2c David Hildenbrand 2021-04-23 1208 return 0;
35d7bdc86031a2c David Hildenbrand 2021-04-23 1209 }
35d7bdc86031a2c David Hildenbrand 2021-04-23 1210
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 8758 bytes --]
[-- Attachment #3: reproduce --]
[-- Type: text/plain, Size: 837 bytes --]
reproduce (this is a W=1 build):
mkdir -p ~/bin
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=35d7bdc86031a2c1ae05ac27dfa93b2acdcbaecc
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 35d7bdc86031a2c1ae05ac27dfa93b2acdcbaecc
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=i386 olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash
reply other threads:[~2023-09-04 0:57 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=ZPUq/wZqDBrUvoLe@rli9-mobl \
--to=philip.li@intel.com \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®