All of lore.kernel.org
 help / color / mirror / Atom feed
* [zen-kernel-zen-kernel:5.12/futex2 3/15] kernel/futex2.c:714:28: error: storage size of 'waitv' isn't known
@ 2021-05-18 16:11 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-05-18 16:11 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://github.com/zen-kernel/zen-kernel 5.12/futex2
head:   a9442359954c51f77fa365e8d15b7950c6aeb55b
commit: 04a97ad2406166e12a13f09c9981f18e6487f530 [3/15] futex2: Implement vectorized wait
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/zen-kernel/zen-kernel/commit/04a97ad2406166e12a13f09c9981f18e6487f530
        git remote add zen-kernel-zen-kernel https://github.com/zen-kernel/zen-kernel
        git fetch --no-tags zen-kernel-zen-kernel 5.12/futex2
        git checkout 04a97ad2406166e12a13f09c9981f18e6487f530
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   kernel/futex2.c:711:16: warning: 'struct compat_futex_waitv' declared inside parameter list will not be visible outside of this definition or declaration
     711 |         struct compat_futex_waitv __user *uwaitv,
         |                ^~~~~~~~~~~~~~~~~~
   kernel/futex2.c: In function 'compat_futex_parse_waitv':
>> kernel/futex2.c:714:28: error: storage size of 'waitv' isn't known
     714 |  struct compat_futex_waitv waitv;
         |                            ^~~~~
>> kernel/futex2.c:719:37: error: invalid use of undefined type 'struct compat_futex_waitv'
     719 |   if (copy_from_user(&waitv, &uwaitv[i], sizeof(waitv)))
         |                                     ^
>> kernel/futex2.c:719:37: error: dereferencing pointer to incomplete type 'struct compat_futex_waitv'
>> kernel/futex2.c:728:31: error: implicit declaration of function 'compat_ptr' [-Werror=implicit-function-declaration]
     728 |   futexv->objects[i].uaddr  = compat_ptr(waitv.uaddr);
         |                               ^~~~~~~~~~
   kernel/futex2.c:714:28: warning: unused variable 'waitv' [-Wunused-variable]
     714 |  struct compat_futex_waitv waitv;
         |                            ^~~~~
   kernel/futex2.c: At top level:
>> kernel/futex2.c:747:36: error: expected ')' before 'struct'
     747 | COMPAT_SYSCALL_DEFINE4(futex_waitv, struct compat_futex_waitv __user *, waiters,
         |                                    ^~~~~~~
         |                                    )
   kernel/futex2.c:710:12: warning: 'compat_futex_parse_waitv' defined but not used [-Wunused-function]
     710 | static int compat_futex_parse_waitv(struct futex_waiter_head *futexv,
         |            ^~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +714 kernel/futex2.c

   700	
   701	#ifdef CONFIG_COMPAT
   702	/**
   703	 * compat_futex_parse_waitv - Parse a waitv array from userspace
   704	 * @futexv:	Kernel side list of waiters to be filled
   705	 * @uwaitv:     Userspace list to be parsed
   706	 * @nr_futexes: Length of futexv
   707	 *
   708	 * Return: Error code on failure, pointer to a prepared futexv otherwise
   709	 */
   710	static int compat_futex_parse_waitv(struct futex_waiter_head *futexv,
   711					    struct compat_futex_waitv __user *uwaitv,
   712					    unsigned int nr_futexes)
   713	{
 > 714		struct compat_futex_waitv waitv;
   715		struct futex_bucket *bucket;
   716		unsigned int i;
   717	
   718		for (i = 0; i < nr_futexes; i++) {
 > 719			if (copy_from_user(&waitv, &uwaitv[i], sizeof(waitv)))
   720				return -EFAULT;
   721	
   722			if ((waitv.flags & ~FUTEXV_WAITER_MASK) ||
   723			    (waitv.flags & FUTEX_SIZE_MASK) != FUTEX_32)
   724				return -EINVAL;
   725	
   726			futexv->objects[i].key.pointer = 0;
   727			futexv->objects[i].flags  = waitv.flags;
 > 728			futexv->objects[i].uaddr  = compat_ptr(waitv.uaddr);
   729			futexv->objects[i].val    = waitv.val;
   730			futexv->objects[i].index  = i;
   731	
   732			bucket = futex_get_bucket(compat_ptr(waitv.uaddr),
   733						  &futexv->objects[i].key,
   734						  is_object_shared);
   735	
   736			if (IS_ERR(bucket))
   737				return PTR_ERR(bucket);
   738	
   739			futexv->objects[i].bucket = bucket;
   740	
   741			INIT_LIST_HEAD(&futexv->objects[i].list);
   742		}
   743	
   744		return 0;
   745	}
   746	
 > 747	COMPAT_SYSCALL_DEFINE4(futex_waitv, struct compat_futex_waitv __user *, waiters,
   748			       unsigned int, nr_futexes, unsigned int, flags,
   749			       struct __kernel_timespec __user *, timo)
   750	{
   751		struct futex_waiter_head *futexv;
   752		int ret;
   753	
   754		if (flags & ~FUTEXV_MASK)
   755			return -EINVAL;
   756	
   757		if (!nr_futexes || nr_futexes > FUTEX_WAITV_MAX || !waiters)
   758			return -EINVAL;
   759	
   760		futexv = kmalloc((sizeof(struct futex_waiter) * nr_futexes) +
   761				 sizeof(*futexv), GFP_KERNEL);
   762		if (!futexv)
   763			return -ENOMEM;
   764	
   765		futexv->hint = false;
   766		futexv->task = current;
   767	
   768		ret = compat_futex_parse_waitv(futexv, waiters, nr_futexes);
   769	
   770		if (!ret)
   771			ret = __futex_waitv(futexv, nr_futexes, timo, flags);
   772	
   773		kfree(futexv);
   774	
   775		return ret;
   776	}
   777	#endif
   778	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 72706 bytes --]

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

only message in thread, other threads:[~2021-05-18 16:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 16:11 [zen-kernel-zen-kernel:5.12/futex2 3/15] kernel/futex2.c:714:28: error: storage size of 'waitv' isn't known 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.