tree: https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git work.uaccess head: 00b19766335a2ce1299e047713b0fef21390f137 commit: 63a83ed9311071a2f7dc99901155d4ea42652973 [25/89] binfmt_flat: flat_{get,put}_addr_from_rp() should be able to fail config: arm-efm32_defconfig (attached as .config) compiler: arm-linux-gnueabi-gcc (Debian 6.1.1-9) 6.1.1 20160705 reproduce: wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross git checkout 63a83ed9311071a2f7dc99901155d4ea42652973 # save the attached .config to linux build tree make.cross ARCH=arm All error/warnings (new ones prefixed by >>): In file included from include/linux/flat.h:12:0, from fs/binfmt_flat.c:36: arch/arm/include/asm/flat.h: In function 'flat_get_addr_from_rp': >> arch/arm/include/asm/flat.h:16:9: error: implicit declaration of function 'copy_from_user' [-Werror=implicit-function-declaration] return copy_from_user(addr, rp, 4) ? -EFAULT : 0; ^~~~~~~~~~~~~~ arch/arm/include/asm/flat.h: In function 'flat_put_addr_at_rp': >> arch/arm/include/asm/flat.h:25:9: error: implicit declaration of function 'copy_to_user' [-Werror=implicit-function-declaration] return copy_to_user(rp, &addr, 4) ? -EFAULT : 0; ^~~~~~~~~~~~ In file included from fs/binfmt_flat.c:37:0: include/linux/uaccess.h: At top level: >> include/linux/uaccess.h:145:1: error: conflicting types for 'copy_from_user' copy_from_user(void *to, const void __user *from, unsigned long n) ^~~~~~~~~~~~~~ In file included from include/linux/flat.h:12:0, from fs/binfmt_flat.c:36: arch/arm/include/asm/flat.h:16:9: note: previous implicit declaration of 'copy_from_user' was here return copy_from_user(addr, rp, 4) ? -EFAULT : 0; ^~~~~~~~~~~~~~ In file included from fs/binfmt_flat.c:37:0: >> include/linux/uaccess.h:164:1: error: conflicting types for 'copy_to_user' copy_to_user(void __user *to, const void *from, unsigned long n) ^~~~~~~~~~~~ In file included from include/linux/flat.h:12:0, from fs/binfmt_flat.c:36: arch/arm/include/asm/flat.h:25:9: note: previous implicit declaration of 'copy_to_user' was here return copy_to_user(rp, &addr, 4) ? -EFAULT : 0; ^~~~~~~~~~~~ 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", ^~~~~~~~ fs/binfmt_flat.c:599:9: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types] reloc = (unsigned long __user *) ^ fs/binfmt_flat.c:624:9: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types] reloc = (unsigned long __user *) ^ cc1: some warnings being treated as errors vim +/copy_from_user +16 arch/arm/include/asm/flat.h 10 #define flat_reloc_valid(reloc, size) ((reloc) <= (size)) 11 12 static inline int flat_get_addr_from_rp(u32 __user *rp, u32 relval, u32 flags, 13 u32 *addr, u32 *persistent) 14 { 15 #ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS > 16 return copy_from_user(addr, rp, 4) ? -EFAULT : 0; 17 #else 18 return get_user(*addr, rp); 19 #endif 20 } 21 22 static inline int flat_put_addr_at_rp(u32 __user *rp, u32 addr, u32 rel) 23 { 24 #ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS > 25 return copy_to_user(rp, &addr, 4) ? -EFAULT : 0; 26 #else 27 return put_user(addr, rp); 28 #endif --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip