From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: Re: [PATCH] binfmt_elf: Support segments with 0 filesz and misaligned starts
Date: Tue, 26 Sep 2023 19:31:08 +0800 [thread overview]
Message-ID: <202309261925.QvgPAYL7-lkp@intel.com> (raw)
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <87jzsemmsd.fsf_-_@email.froward.int.ebiederm.org>
References: <87jzsemmsd.fsf_-_@email.froward.int.ebiederm.org>
TO: "Eric W. Biederman" <ebiederm@xmission.com>
TO: Sebastian Ott <sebott@redhat.com>
CC: "Thomas Weißschuh" <linux@weissschuh.net>
CC: Alexander Viro <viro@zeniv.linux.org.uk>
CC: Christian Brauner <brauner@kernel.org>
CC: Kees Cook <keescook@chromium.org>
CC: Mark Brown <broonie@kernel.org>
CC: Willy Tarreau <w@1wt.eu>
CC: linux-fsdevel@vger.kernel.org
CC: linux-mm@kvack.org
CC: linux-kernel@vger.kernel.org
CC: stable@vger.kernel.org
Hi Eric,
kernel test robot noticed the following build warnings:
[auto build test WARNING on kees/for-next/execve]
[also build test WARNING on linus/master v6.6-rc3 next-20230926]
[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/Eric-W-Biederman/binfmt_elf-Support-segments-with-0-filesz-and-misaligned-starts/20230925-210022
base: https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/execve
patch link: https://lore.kernel.org/r/87jzsemmsd.fsf_-_%40email.froward.int.ebiederm.org
patch subject: [PATCH] binfmt_elf: Support segments with 0 filesz and misaligned starts
:::::: branch date: 22 hours ago
:::::: commit date: 22 hours ago
config: i386-randconfig-141-20230926 (https://download.01.org/0day-ci/archive/20230926/202309261925.QvgPAYL7-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230926/202309261925.QvgPAYL7-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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202309261925.QvgPAYL7-lkp@intel.com/
smatch warnings:
fs/binfmt_elf.c:431 elf_load() error: uninitialized symbol 'map_addr'.
vim +/map_addr +431 fs/binfmt_elf.c
^1da177e4c3f41 Linus Torvalds 2005-04-16 389
a6409120b31666 Eric W. Biederman 2023-09-25 390 static unsigned long elf_load(struct file *filep, unsigned long addr,
a6409120b31666 Eric W. Biederman 2023-09-25 391 const struct elf_phdr *eppnt, int prot, int type,
a6409120b31666 Eric W. Biederman 2023-09-25 392 unsigned long total_size)
a6409120b31666 Eric W. Biederman 2023-09-25 393 {
a6409120b31666 Eric W. Biederman 2023-09-25 394 unsigned long zero_start, zero_end;
a6409120b31666 Eric W. Biederman 2023-09-25 395 unsigned long map_addr;
a6409120b31666 Eric W. Biederman 2023-09-25 396
a6409120b31666 Eric W. Biederman 2023-09-25 397 if (eppnt->p_filesz) {
a6409120b31666 Eric W. Biederman 2023-09-25 398 map_addr = elf_map(filep, addr, eppnt, prot, type, total_size);
a6409120b31666 Eric W. Biederman 2023-09-25 399 if (BAD_ADDR(map_addr))
a6409120b31666 Eric W. Biederman 2023-09-25 400 return map_addr;
a6409120b31666 Eric W. Biederman 2023-09-25 401 if (eppnt->p_memsz > eppnt->p_filesz) {
a6409120b31666 Eric W. Biederman 2023-09-25 402 zero_start = map_addr + ELF_PAGEOFFSET(eppnt->p_vaddr) +
a6409120b31666 Eric W. Biederman 2023-09-25 403 eppnt->p_filesz;
a6409120b31666 Eric W. Biederman 2023-09-25 404 zero_end = map_addr + ELF_PAGEOFFSET(eppnt->p_vaddr) +
a6409120b31666 Eric W. Biederman 2023-09-25 405 eppnt->p_memsz;
a6409120b31666 Eric W. Biederman 2023-09-25 406
a6409120b31666 Eric W. Biederman 2023-09-25 407 /* Zero the end of the last mapped page */
a6409120b31666 Eric W. Biederman 2023-09-25 408 padzero(zero_start);
a6409120b31666 Eric W. Biederman 2023-09-25 409 }
a6409120b31666 Eric W. Biederman 2023-09-25 410 } else {
a6409120b31666 Eric W. Biederman 2023-09-25 411 zero_start = ELF_PAGESTART(addr);
a6409120b31666 Eric W. Biederman 2023-09-25 412 zero_end = zero_start + ELF_PAGEOFFSET(eppnt->p_vaddr) +
a6409120b31666 Eric W. Biederman 2023-09-25 413 eppnt->p_memsz;
a6409120b31666 Eric W. Biederman 2023-09-25 414 }
a6409120b31666 Eric W. Biederman 2023-09-25 415 if (eppnt->p_memsz > eppnt->p_filesz) {
a6409120b31666 Eric W. Biederman 2023-09-25 416 /*
a6409120b31666 Eric W. Biederman 2023-09-25 417 * Map the last of the segment.
a6409120b31666 Eric W. Biederman 2023-09-25 418 * If the header is requesting these pages to be
a6409120b31666 Eric W. Biederman 2023-09-25 419 * executable, honour that (ppc32 needs this).
a6409120b31666 Eric W. Biederman 2023-09-25 420 */
a6409120b31666 Eric W. Biederman 2023-09-25 421 int error;
a6409120b31666 Eric W. Biederman 2023-09-25 422
a6409120b31666 Eric W. Biederman 2023-09-25 423 zero_start = ELF_PAGEALIGN(zero_start);
a6409120b31666 Eric W. Biederman 2023-09-25 424 zero_end = ELF_PAGEALIGN(zero_end);
a6409120b31666 Eric W. Biederman 2023-09-25 425
a6409120b31666 Eric W. Biederman 2023-09-25 426 error = vm_brk_flags(zero_start, zero_end - zero_start,
a6409120b31666 Eric W. Biederman 2023-09-25 427 prot & PROT_EXEC ? VM_EXEC : 0);
a6409120b31666 Eric W. Biederman 2023-09-25 428 if (error)
a6409120b31666 Eric W. Biederman 2023-09-25 429 map_addr = error;
a6409120b31666 Eric W. Biederman 2023-09-25 430 }
a6409120b31666 Eric W. Biederman 2023-09-25 @431 return map_addr;
a6409120b31666 Eric W. Biederman 2023-09-25 432 }
a6409120b31666 Eric W. Biederman 2023-09-25 433
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2023-09-26 11:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-26 11:31 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-09-14 15:59 [PATCH RFC] binfmt_elf: fully allocate bss pages Thomas Weißschuh
2023-09-21 10:36 ` Sebastian Ott
2023-09-25 0:50 ` Eric W. Biederman
2023-09-25 9:20 ` Sebastian Ott
2023-09-25 12:59 ` [PATCH] binfmt_elf: Support segments with 0 filesz and misaligned starts Eric W. Biederman
2023-09-25 13:00 ` kernel test robot
2023-09-25 13:07 ` Eric W. Biederman
2023-09-25 15:27 ` Sebastian Ott
2023-09-25 17:06 ` Kees Cook
2023-09-26 3:27 ` Eric W. Biederman
2023-09-27 2:34 ` Kees Cook
2023-09-26 13:49 ` Dan Carpenter
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=202309261925.QvgPAYL7-lkp@intel.com \
--to=lkp@intel.com \
--cc=error27@gmail.com \
--cc=oe-kbuild@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 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.