From: kbuild test robot <lkp@intel.com>
To: Jann Horn <jannh@google.com>
Cc: kbuild-all@01.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
Linux Memory Management List <linux-mm@kvack.org>
Subject: [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: Wed, 3 Jul 2019 13:40:01 +0800 [thread overview]
Message-ID: <201907031359.mWESdRcD%lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 3951 bytes --]
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@intel.com>
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 #2: .config.gz --]
[-- Type: application/gzip, Size: 41993 bytes --]
reply other threads:[~2019-07-03 5:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=201907031359.mWESdRcD%lkp@intel.com \
--to=lkp@intel.com \
--cc=akpm@linux-foundation.org \
--cc=gregkh@linuxfoundation.org \
--cc=jannh@google.com \
--cc=kbuild-all@01.org \
--cc=linux-mm@kvack.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