From: kernel test robot <lkp@intel.com>
To: Jinjiang Tu <tujinjiang@huawei.com>,
akpm@linux-foundation.org, david@redhat.com, shr@devkernel.io,
hannes@cmpxchg.org, riel@surriel.com, wangkefeng.wang@huawei.com,
sunnanyong@huawei.com, linux-mm@kvack.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
tujinjiang@huawei.com
Subject: Re: [PATCH v2 1/2] mm/ksm: fix ksm exec support for prctl
Date: Sun, 24 Mar 2024 08:03:07 +0800 [thread overview]
Message-ID: <202403240716.8B7CiDbr-lkp@intel.com> (raw)
In-Reply-To: <20240322060947.3254967-2-tujinjiang@huawei.com>
Hi Jinjiang,
kernel test robot noticed the following build warnings:
[auto build test WARNING on akpm-mm/mm-everything]
url: https://github.com/intel-lab-lkp/linux/commits/Jinjiang-Tu/mm-ksm-fix-ksm-exec-support-for-prctl/20240322-141317
base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link: https://lore.kernel.org/r/20240322060947.3254967-2-tujinjiang%40huawei.com
patch subject: [PATCH v2 1/2] mm/ksm: fix ksm exec support for prctl
config: s390-allnoconfig (https://download.01.org/0day-ci/archive/20240324/202403240716.8B7CiDbr-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 23de3862dce582ce91c1aa914467d982cb1a73b4)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240324/202403240716.8B7CiDbr-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/202403240716.8B7CiDbr-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from fs/exec.c:30:
In file included from include/linux/mm.h:2211:
include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
514 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
>> fs/exec.c:275:6: warning: variable 'err' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
275 | if (ksm_execve(mm))
| ^~~~~~~~~~~~~~
fs/exec.c:305:9: note: uninitialized use occurs here
305 | return err;
| ^~~
fs/exec.c:275:2: note: remove the 'if' if its condition is always false
275 | if (ksm_execve(mm))
| ^~~~~~~~~~~~~~~~~~~
276 | goto err_ksm;
| ~~~~~~~~~~~~
fs/exec.c:257:9: note: initialize the variable 'err' to silence this warning
257 | int err;
| ^
| = 0
2 warnings generated.
vim +275 fs/exec.c
254
255 static int __bprm_mm_init(struct linux_binprm *bprm)
256 {
257 int err;
258 struct vm_area_struct *vma = NULL;
259 struct mm_struct *mm = bprm->mm;
260
261 bprm->vma = vma = vm_area_alloc(mm);
262 if (!vma)
263 return -ENOMEM;
264 vma_set_anonymous(vma);
265
266 if (mmap_write_lock_killable(mm)) {
267 err = -EINTR;
268 goto err_free;
269 }
270
271 /*
272 * Need to be called with mmap write lock
273 * held, to avoid race with ksmd.
274 */
> 275 if (ksm_execve(mm))
276 goto err_ksm;
277
278 /*
279 * Place the stack at the largest stack address the architecture
280 * supports. Later, we'll move this to an appropriate place. We don't
281 * use STACK_TOP because that can depend on attributes which aren't
282 * configured yet.
283 */
284 BUILD_BUG_ON(VM_STACK_FLAGS & VM_STACK_INCOMPLETE_SETUP);
285 vma->vm_end = STACK_TOP_MAX;
286 vma->vm_start = vma->vm_end - PAGE_SIZE;
287 vm_flags_init(vma, VM_SOFTDIRTY | VM_STACK_FLAGS | VM_STACK_INCOMPLETE_SETUP);
288 vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
289
290 err = insert_vm_struct(mm, vma);
291 if (err)
292 goto err;
293
294 mm->stack_vm = mm->total_vm = 1;
295 mmap_write_unlock(mm);
296 bprm->p = vma->vm_end - sizeof(void *);
297 return 0;
298 err:
299 ksm_exit(mm);
300 err_ksm:
301 mmap_write_unlock(mm);
302 err_free:
303 bprm->vma = NULL;
304 vm_area_free(vma);
305 return err;
306 }
307
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2024-03-24 0:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-22 6:09 [PATCH v2 0/2] mm/ksm: fix ksm exec support for prctl Jinjiang Tu
2024-03-22 6:09 ` [PATCH v2 1/2] " Jinjiang Tu
2024-03-22 9:02 ` David Hildenbrand
2024-03-25 2:24 ` Jinjiang Tu
2024-03-25 8:33 ` David Hildenbrand
2024-03-24 0:03 ` kernel test robot [this message]
2024-03-25 5:44 ` Dan Carpenter
2024-03-25 6:33 ` Jinjiang Tu
2024-03-22 6:09 ` [PATCH v2 2/2] selftest/mm: ksm_functional_tests: extend test case for ksm fork/exec Jinjiang Tu
2024-03-22 11:43 ` David Hildenbrand
2024-03-25 2:24 ` Jinjiang Tu
2024-03-25 8:38 ` David Hildenbrand
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=202403240716.8B7CiDbr-lkp@intel.com \
--to=lkp@intel.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=hannes@cmpxchg.org \
--cc=linux-mm@kvack.org \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=riel@surriel.com \
--cc=shr@devkernel.io \
--cc=sunnanyong@huawei.com \
--cc=tujinjiang@huawei.com \
--cc=wangkefeng.wang@huawei.com \
/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;
as well as URLs for NNTP newsgroup(s).