All of lore.kernel.org
 help / color / mirror / Atom feed
* [vfs:untested-uaccess 46/79] arch/mips/include/asm/uaccess.h:138:21: warning: passing argument 1 of '__access_ok' makes pointer from integer without a cast
@ 2017-03-26  4:14 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2017-03-26  4:14 UTC (permalink / raw)
  To: Al Viro; +Cc: kbuild-all, linux-fsdevel

[-- Attachment #1: Type: text/plain, Size: 3227 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git untested-uaccess
head:   e4c5cc79ec8eab6bc3e74d9994b33f368f137223
commit: 6efb94be5437e7943854e8a60fc0cc7f280232e2 [46/79] mips: sanitize __access_ok()
config: mips-allyesconfig (attached as .config)
compiler: mips-linux-gnu-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 6efb94be5437e7943854e8a60fc0cc7f280232e2
        # save the attached .config to linux build tree
        make.cross ARCH=mips 

All warnings (new ones prefixed by >>):

   In file included from include/uapi/linux/stddef.h:1:0,
                    from include/linux/stddef.h:4,
                    from include/uapi/linux/posix_types.h:4,
                    from include/uapi/linux/types.h:13,
                    from include/linux/types.h:5,
                    from include/linux/oprofile.h:16,
                    from arch/mips/oprofile/backtrace.c:1:
   arch/mips/oprofile/backtrace.c: In function 'get_mem':
>> arch/mips/include/asm/uaccess.h:138:21: warning: passing argument 1 of '__access_ok' makes pointer from integer without a cast [-Wint-conversion]
     likely(__access_ok((addr), (size)))
                        ^
   include/linux/compiler.h:178:40: note: in definition of macro 'likely'
    # define likely(x) __builtin_expect(!!(x), 1)
                                           ^
   arch/mips/oprofile/backtrace.c:21:7: note: in expansion of macro 'access_ok'
     if (!access_ok(VERIFY_READ, addr, sizeof(unsigned long)))
          ^~~~~~~~~
   In file included from include/linux/uaccess.h:13:0,
                    from arch/mips/oprofile/backtrace.c:4:
   arch/mips/include/asm/uaccess.h:131:19: note: expected 'const void *' but argument is of type 'long unsigned int'
    static inline int __access_ok(const void __user *p, unsigned long size)
                      ^~~~~~~~~~~

vim +/__access_ok +138 arch/mips/include/asm/uaccess.h

   122	 *
   123	 * Returns true (nonzero) if the memory block may be valid, false (zero)
   124	 * if it is definitely invalid.
   125	 *
   126	 * Note that, depending on architecture, this function probably just
   127	 * checks that the pointer is in the user space range - after calling
   128	 * this function, memory access functions may still return -EFAULT.
   129	 */
   130	
   131	static inline int __access_ok(const void __user *p, unsigned long size)
   132	{
   133		unsigned long addr = (unsigned long)p;
   134		return (get_fs().seg & (addr | (addr + size) | __ua_size(size))) == 0;
   135	}
   136	
   137	#define access_ok(type, addr, size)					\
 > 138		likely(__access_ok((addr), (size)))
   139	
   140	/*
   141	 * put_user: - Write a simple value into user space.
   142	 * @x:	 Value to copy to user space.
   143	 * @ptr: Destination address, in user space.
   144	 *
   145	 * Context: User context only. This function may sleep if pagefaults are
   146	 *          enabled.

---
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: 45713 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-03-26  4:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-26  4:14 [vfs:untested-uaccess 46/79] arch/mips/include/asm/uaccess.h:138:21: warning: passing argument 1 of '__access_ok' makes pointer from integer without a cast kbuild test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.