tree: https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git uaccess-fixes head: e0d18a84b133198aacb436f5a1c2a6ed97ec0155 commit: 526c77b355190f73bc292d0466bb3da69de1ff98 [3/28] asm-generic: make get_user() clear the destination on errors config: um-x86_64_defconfig (attached as .config) compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705 reproduce: git checkout 526c77b355190f73bc292d0466bb3da69de1ff98 # save the attached .config to linux build tree make ARCH=um SUBARCH=x86_64 All warnings (new ones prefixed by >>): In file included from arch/um/include/asm/uaccess.h:42:0, from include/linux/uaccess.h:5, from include/linux/highmem.h:8, from include/linux/pagemap.h:10, from fs/exec.c:35: fs/exec.c: In function 'get_user_arg_ptr': >> include/asm-generic/uaccess.h:232:46: warning: pointer/integer type mismatch in conditional expression __get_user((x), (__typeof__(*(ptr)) *)__p) : \ ^ >> fs/exec.c:425:6: note: in expansion of macro 'get_user' if (get_user(native, argv.ptr.native + nr)) ^~~~~~~~ vim +232 include/asm-generic/uaccess.h eed417dd Arnd Bergmann 2009-05-13 216 ptr, &__x); \ eed417dd Arnd Bergmann 2009-05-13 217 (x) = *(__force __typeof__(*(ptr)) *) &__x; \ eed417dd Arnd Bergmann 2009-05-13 218 break; \ eed417dd Arnd Bergmann 2009-05-13 219 }; \ eed417dd Arnd Bergmann 2009-05-13 220 default: \ eed417dd Arnd Bergmann 2009-05-13 221 __get_user_bad(); \ eed417dd Arnd Bergmann 2009-05-13 222 break; \ eed417dd Arnd Bergmann 2009-05-13 223 } \ eed417dd Arnd Bergmann 2009-05-13 224 __gu_err; \ eed417dd Arnd Bergmann 2009-05-13 225 }) eed417dd Arnd Bergmann 2009-05-13 226 eed417dd Arnd Bergmann 2009-05-13 227 #define get_user(x, ptr) \ eed417dd Arnd Bergmann 2009-05-13 228 ({ \ a02613a4 Yoshinori Sato 2015-07-16 229 const void *__p = (ptr); \ e0acd0bd Michael S. Tsirkin 2013-05-26 230 might_fault(); \ a02613a4 Yoshinori Sato 2015-07-16 231 access_ok(VERIFY_READ, __p, sizeof(*ptr)) ? \ a02613a4 Yoshinori Sato 2015-07-16 @232 __get_user((x), (__typeof__(*(ptr)) *)__p) : \ 526c77b3 Al Viro 2016-08-17 233 ((x) = (__typeof__(*(ptr)))0),-EFAULT; \ eed417dd Arnd Bergmann 2009-05-13 234 }) eed417dd Arnd Bergmann 2009-05-13 235 05d88a49 Vineet Gupta 2013-01-18 236 #ifndef __get_user_fn eed417dd Arnd Bergmann 2009-05-13 237 static inline int __get_user_fn(size_t size, const void __user *ptr, void *x) eed417dd Arnd Bergmann 2009-05-13 238 { 526c77b3 Al Viro 2016-08-17 239 size_t n = __copy_from_user(x, ptr, size); 526c77b3 Al Viro 2016-08-17 240 if (unlikely(n)) { :::::: The code at line 232 was first introduced by commit :::::: a02613a4ba679eacec8251976d02809d533fa717 asm-generic: {get,put}_user ptr argument evaluate only 1 time :::::: TO: Yoshinori Sato <ysato@xxxxxxxxxxxxxxxxxxxx> :::::: CC: Yoshinori Sato <ysato@xxxxxxxxxxxxxxxxxxxx> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: Binary data