All of lore.kernel.org
 help / color / mirror / Atom feed
* [intel-lts:4.19/android_s 1/2] lib/usercopy.c:64:9: sparse: sparse: incorrect type in initializer (different address spaces)
@ 2024-04-09  8:46 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-04-09  8:46 UTC (permalink / raw)
  Cc: oe-kbuild-all

tree:   https://android.googlesource.com/kernel/common 4.19/android_s
head:   71b63f21a8292ca960a4c363d69d5e95c0265597
commit: 6a1e36af9d0e008f78f324581e5f1cb5c4393aee [1/2] BACKPORT: lib: introduce copy_struct_from_user() helper
config: m68k-randconfig-r123-20240406 (https://download.01.org/0day-ci/archive/20240409/202404091648.NSToEhRO-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20240409/202404091648.NSToEhRO-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202404091648.NSToEhRO-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> lib/usercopy.c:64:9: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const *__gu_ptr @@     got unsigned long [noderef] <asn:1> * @@
   lib/usercopy.c:64:9: sparse:     expected void const *__gu_ptr
   lib/usercopy.c:64:9: sparse:     got unsigned long [noderef] <asn:1> *
   lib/usercopy.c:75:17: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const *__gu_ptr @@     got unsigned long [noderef] <asn:1> * @@
   lib/usercopy.c:75:17: sparse:     expected void const *__gu_ptr
   lib/usercopy.c:75:17: sparse:     got unsigned long [noderef] <asn:1> *

vim +64 lib/usercopy.c

    35	
    36	/**
    37	 * check_zeroed_user: check if a userspace buffer only contains zero bytes
    38	 * @from: Source address, in userspace.
    39	 * @size: Size of buffer.
    40	 *
    41	 * This is effectively shorthand for "memchr_inv(from, 0, size) == NULL" for
    42	 * userspace addresses (and is more efficient because we don't care where the
    43	 * first non-zero byte is).
    44	 *
    45	 * Returns:
    46	 *  * 0: There were non-zero bytes present in the buffer.
    47	 *  * 1: The buffer was full of zero bytes.
    48	 *  * -EFAULT: access to userspace failed.
    49	 */
    50	int check_zeroed_user(const void __user *from, size_t size)
    51	{
    52		unsigned long val;
    53		uintptr_t align = (uintptr_t) from % sizeof(unsigned long);
    54	
    55		if (unlikely(size == 0))
    56			return 1;
    57	
    58		from -= align;
    59		size += align;
    60	
    61		if (!user_access_begin(VERIFY_READ, from, size))
    62			return -EFAULT;
    63	
  > 64		unsafe_get_user(val, (unsigned long __user *) from, err_fault);

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

only message in thread, other threads:[~2024-04-09  8:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-09  8:46 [intel-lts:4.19/android_s 1/2] lib/usercopy.c:64:9: sparse: sparse: incorrect type in initializer (different address spaces) kernel 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.