linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: kernel test robot <lkp@intel.com>, Luis Chamberlain <mcgrof@kernel.org>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [mcgrof:modules-next 1/1] include/linux/kern_levels.h:5:18: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'Elf32_Off' {aka 'unsigned int'}
Date: Wed, 13 Oct 2021 11:09:15 -0600	[thread overview]
Message-ID: <c4be5b17-3071-0d99-f896-40040c81d9d3@linuxfoundation.org> (raw)
In-Reply-To: <202110140056.Fb6aizTM-lkp@intel.com>

Hi Luis,

On 10/13/21 10:42 AM, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git modules-next
> head:   8b1185a4427b772b9f02376a08272c3019777581
> commit: 8b1185a4427b772b9f02376a08272c3019777581 [1/1] module: change to print useful messages from elf_validity_check()
> config: um-i386_defconfig (attached as .config)
> compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
> reproduce (this is a W=1 build):
>          # https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git/commit/?id=8b1185a4427b772b9f02376a08272c3019777581
>          git remote add mcgrof https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git
>          git fetch --no-tags mcgrof modules-next
>          git checkout 8b1185a4427b772b9f02376a08272c3019777581
>          # save the attached .config to linux build tree
>          make W=1 ARCH=um SUBARCH=i386
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All warnings (new ones prefixed by >>):
> 

All of these warnings can be fixed easily by leaving out the fields that
are the problem. I can send a patch for that.

This one is real issue though;

static int validate_section_offset(struct load_info *info, Elf_Shdr *shdr)
{
         unsigned long secend; /* too short when sh_offset is Elf64_Off */

         /*
          * Check for both overflow and offset/size being
          * too large.
          */
         secend = shdr->sh_offset + shdr->sh_size;


secend is unsigned long which is too short when sh_offset is Elf64_Off

It appears to me that some sections of this elf validation code probably
needs to be arch specific. validate_section_offset() is one with this
potential for secend overflow.

We can introduce arch specific header print routine. Easy option is not
printing any info., which we know isn't very useful.

Let me know your thoughts.

thanks,
-- Shuah

  reply	other threads:[~2021-10-13 17:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-13 16:42 [mcgrof:modules-next 1/1] include/linux/kern_levels.h:5:18: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'Elf32_Off' {aka 'unsigned int'} kernel test robot
2021-10-13 17:09 ` Shuah Khan [this message]
2021-10-13 21:18   ` Luis Chamberlain
2021-10-13 22:16     ` Shuah Khan
2021-10-13 22:40       ` Luis Chamberlain

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=c4be5b17-3071-0d99-f896-40040c81d9d3@linuxfoundation.org \
    --to=skhan@linuxfoundation.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=mcgrof@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 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).