tree: https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git work.uaccess-unaligned head: 8c06bc3844907d370b6c651175e86bbec9868eca commit: 2b47a4d7243634e0b7a46282fa7fd454792cca44 [1/2] binfmt_flat: flat_{get,put}_addr_from_rp() should be able to fail config: m32r-oaks32r_defconfig (attached as .config) compiler: m32r-linux-gcc (GCC) 6.2.0 reproduce: wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross git checkout 2b47a4d7243634e0b7a46282fa7fd454792cca44 # save the attached .config to linux build tree make.cross ARCH=m32r All errors (new ones prefixed by >>): In file included from include/linux/kernel.h:13:0, from fs/binfmt_flat.c:20: fs/binfmt_flat.c: In function 'load_flat_file': include/linux/kern_levels.h:4:18: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'u32 {aka unsigned int}' [-Wformat=] #define KERN_SOH "\001" /* ASCII Start Of Header */ ^ include/linux/printk.h:136:11: note: in definition of macro 'no_printk' printk(fmt, ##__VA_ARGS__); \ ^~~ include/linux/kern_levels.h:14:20: note: in expansion of macro 'KERN_SOH' #define KERN_DEBUG KERN_SOH "7" /* debug-level messages */ ^~~~~~~~ include/linux/printk.h:339:12: note: in expansion of macro 'KERN_DEBUG' no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) ^~~~~~~~~~ fs/binfmt_flat.c:577:3: note: in expansion of macro 'pr_debug' pr_debug("Allocated data+bss+stack (%ld bytes): %lx\n", ^~~~~~~~ In file included from include/linux/flat.h:13:0, from fs/binfmt_flat.c:36: >> fs/binfmt_flat.c:809:32: error: passing argument 1 of 'm32r_flat_get_addr_from_rp' from incompatible pointer type [-Werror=incompatible-pointer-types] ret = flat_get_addr_from_rp(rp, relval, flags, ^ arch/m32r/include/asm/flat.h:140:30: note: in definition of macro 'flat_get_addr_from_rp' (m32r_flat_get_addr_from_rp(rp, relval, text_len), 0) ^~ arch/m32r/include/asm/flat.h:55:29: note: expected 'long unsigned int *' but argument is of type 'u32 * {aka unsigned int *}' static inline unsigned long m32r_flat_get_addr_from_rp (unsigned long *rp, ^~~~~~~~~~~~~~~~~~~~~~~~~~ >> fs/binfmt_flat.c:828:9: error: void value not ignored as it ought to be ret = flat_put_addr_at_rp(rp, addr, relval); ^ cc1: some warnings being treated as errors vim +/m32r_flat_get_addr_from_rp +809 fs/binfmt_flat.c 803 if (rp == (u32 __user *)RELOC_FAILED) { 804 ret = -ENOEXEC; 805 goto err; 806 } 807 808 /* Get the pointer's value. */ > 809 ret = flat_get_addr_from_rp(rp, relval, flags, 810 &addr, &persistent); 811 if (unlikely(ret)) 812 goto err; 813 814 if (addr != 0) { 815 /* 816 * Do the relocation. PIC relocs in the data section are 817 * already in target order 818 */ 819 if ((flags & FLAT_FLAG_GOTPIC) == 0) 820 addr = ntohl(addr); 821 addr = calc_reloc(addr, libinfo, id, 0); 822 if (addr == RELOC_FAILED) { 823 ret = -ENOEXEC; 824 goto err; 825 } 826 827 /* Write back the relocated pointer. */ > 828 ret = flat_put_addr_at_rp(rp, addr, relval); 829 if (unlikely(ret)) 830 goto err; 831 } --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip