[linux-stable-rc:linux-4.9.y 9980/9999] fs/binfmt_flat.c:883:31: warning: passing argument 2 of 'kernel_read' makes integer from pointer without a cast

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.9.y
head:   a9678fbccb5b2c4fb36f8de03434947d26a87de5
commit: f35de5b035f321496bba41d78ab20a33542cc3ba [9980/9999] fs/binfmt_flat.c: make load_flat_shared_library() work
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout f35de5b035f321496bba41d78ab20a33542cc3ba
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=sh 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

   fs/binfmt_flat.c: In function 'load_flat_shared_library':
>> fs/binfmt_flat.c:883:31: warning: passing argument 2 of 'kernel_read' makes integer from pointer without a cast [-Wint-conversion]
     res = kernel_read(bprm.file, bprm.buf, BINPRM_BUF_SIZE, &pos);
                                  ^~~~
   In file included from fs/binfmt_flat.c:27:0:
   include/linux/fs.h:2711:12: note: expected 'loff_t {aka long long int}' but argument is of type 'char *'
    extern int kernel_read(struct file *, loff_t, char *, unsigned long);
               ^~~~~~~~~~~
   In file included from include/linux/binfmts.h:7:0,
                    from fs/binfmt_flat.c:32:
>> include/uapi/linux/binfmts.h:18:25: warning: passing argument 3 of 'kernel_read' makes pointer from integer without a cast [-Wint-conversion]
    #define BINPRM_BUF_SIZE 128
                            ^
>> fs/binfmt_flat.c:883:41: note: in expansion of macro 'BINPRM_BUF_SIZE'
     res = kernel_read(bprm.file, bprm.buf, BINPRM_BUF_SIZE, &pos);
                                            ^~~~~~~~~~~~~~~
   In file included from fs/binfmt_flat.c:27:0:
   include/linux/fs.h:2711:12: note: expected 'char *' but argument is of type 'int'
    extern int kernel_read(struct file *, loff_t, char *, unsigned long);
               ^~~~~~~~~~~
   fs/binfmt_flat.c:883:58: warning: passing argument 4 of 'kernel_read' makes integer from pointer without a cast [-Wint-conversion]
     res = kernel_read(bprm.file, bprm.buf, BINPRM_BUF_SIZE, &pos);
                                                             ^
   In file included from fs/binfmt_flat.c:27:0:
   include/linux/fs.h:2711:12: note: expected 'long unsigned int' but argument is of type 'loff_t * {aka long long int *}'
    extern int kernel_read(struct file *, loff_t, char *, unsigned long);
               ^~~~~~~~~~~

vim +/kernel_read +883 fs/binfmt_flat.c

   854	
   855	/*
   856	 * Load a shared library into memory.  The library gets its own data
   857	 * segment (including bss) but not argv/argc/environ.
   858	 */
   859	
   860	static int load_flat_shared_library(int id, struct lib_info *libs)
   861	{
   862		/*
   863		 * This is a fake bprm struct; only the members "buf", "file" and
   864		 * "filename" are actually used.
   865		 */
   866		struct linux_binprm bprm;
   867		int res;
   868		char buf[16];
   869		loff_t pos = 0;
   870	
   871		memset(&bprm, 0, sizeof(bprm));
   872	
   873		/* Create the file name */
   874		sprintf(buf, "/lib/lib%d.so", id);
   875	
   876		/* Open the file up */
   877		bprm.filename = buf;
   878		bprm.file = open_exec(bprm.filename);
   879		res = PTR_ERR(bprm.file);
   880		if (IS_ERR(bprm.file))
   881			return res;
   882	
 > 883		res = kernel_read(bprm.file, bprm.buf, BINPRM_BUF_SIZE, &pos);
   884	
   885		if (res >= 0)
   886			res = load_flat_file(&bprm, libs, id, NULL);
   887	
   888		allow_write_access(bprm.file);
   889		fput(bprm.file);
   890	
   891		return res;
   892	}
   893	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux