lkml.org 
[lkml]   [2021]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [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'}
From
Date
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

\
 
 \ /
  Last update: 2021-10-13 19:10    [W:0.067 / U:0.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site