tree:
https://android.googlesource.com/kernel/goldfish android-3.18
head: f8518c639e676ad220b502a48e9ca17f43cdf820
commit: 693b3a2d95ecb7e80d9e693f0fb51449d311d4c6 [381/397] xfs: in _attrlist_by_handle,
copy the cursor back to userspace
config: m68k-randconfig-s032-20210318 (attached as .config)
compiler: m68k-linux-gcc (GCC) 5.5.0
reproduce:
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-277-gc089cd2d-dirty
git remote add android-goldfish
https://android.googlesource.com/kernel/goldfish
git fetch --no-tags android-goldfish android-3.18
git checkout 693b3a2d95ecb7e80d9e693f0fb51449d311d4c6
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-5.5.0 make.cross C=1
CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=m68k
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
fs/xfs/xfs_ioctl.c:125:13: sparse: sparse: incorrect type in argument 1 (different
address spaces) @@ expected void * @@ got void [noderef] <asn:1> *[usertype]
ohandle @@
fs/xfs/xfs_ioctl.c:125:13: sparse: expected void *
fs/xfs/xfs_ioctl.c:125:13: sparse: got void [noderef] <asn:1> *[usertype]
ohandle
fs/xfs/xfs_ioctl.c:126:13: sparse: sparse: incorrect type in argument 1 (different
address spaces) @@ expected void * @@ got unsigned int [noderef] [usertype]
<asn:1> *[usertype] ohandlen @@
fs/xfs/xfs_ioctl.c:126:13: sparse: expected void *
fs/xfs/xfs_ioctl.c:126:13: sparse: got unsigned int [noderef] [usertype]
<asn:1> *[usertype] ohandlen
fs/xfs/xfs_ioctl.c:171:13: sparse: sparse: incorrect type in argument 2 (different
address spaces) @@ expected void const * @@ got void [noderef] <asn:1>
*uhandle @@
fs/xfs/xfs_ioctl.c:171:13: sparse: expected void const *
fs/xfs/xfs_ioctl.c:171:13: sparse: got void [noderef] <asn:1> *uhandle
fs/xfs/xfs_ioctl.c:297:13: sparse: sparse: incorrect type in argument 2 (different
address spaces) @@ expected void const * @@ got unsigned int [noderef] [usertype]
<asn:1> *[usertype] ohandlen @@
fs/xfs/xfs_ioctl.c:297:13: sparse: expected void const *
fs/xfs/xfs_ioctl.c:297:13: sparse: got unsigned int [noderef] [usertype]
<asn:1> *[usertype] ohandlen
fs/xfs/xfs_ioctl.c:368:13: sparse: sparse: incorrect type in argument 2 (different
address spaces) @@ expected void const * @@ got void [noderef] <asn:1> *arg
@@
fs/xfs/xfs_ioctl.c:368:13: sparse: expected void const *
fs/xfs/xfs_ioctl.c:368:13: sparse: got void [noderef] <asn:1> *arg
fs/xfs/xfs_ioctl.c:386:13: sparse: sparse: incorrect type in argument 2 (different
address spaces) @@ expected void const * @@ got struct fsdmidata [noderef]
<asn:1> *[addressable] [usertype] data @@
fs/xfs/xfs_ioctl.c:386:13: sparse: expected void const *
fs/xfs/xfs_ioctl.c:386:13: sparse: got struct fsdmidata [noderef] <asn:1>
*[addressable] [usertype] data
fs/xfs/xfs_ioctl.c:414:13: sparse: sparse: incorrect type in argument 2 (different
address spaces) @@ expected void const * @@ got void [noderef] <asn:1> *arg
@@
fs/xfs/xfs_ioctl.c:414:13: sparse: expected void const *
fs/xfs/xfs_ioctl.c:414:13: sparse: got void [noderef] <asn:1> *arg
> fs/xfs/xfs_ioctl.c:440:13: sparse: sparse: incorrect type in
argument 1 (different address spaces) @@ expected void * @@ got struct
xfs_attrlist_cursor [noderef] <asn:1> * @@
fs/xfs/xfs_ioctl.c:440:13:
sparse: expected void *
fs/xfs/xfs_ioctl.c:440:13: sparse: got struct xfs_attrlist_cursor [noderef]
<asn:1> *
fs/xfs/xfs_ioctl.c:445:13: sparse: sparse: incorrect type in argument 1 (different
address spaces) @@ expected void * @@ got void [noderef] <asn:1>
*[addressable] [usertype] buffer @@
fs/xfs/xfs_ioctl.c:445:13: sparse: expected void *
fs/xfs/xfs_ioctl.c:445:13: sparse: got void [noderef] <asn:1> *[addressable]
[usertype] buffer
fs/xfs/xfs_ioctl.c:476:13: sparse: sparse: incorrect type in argument 1 (different
address spaces) @@ expected void * @@ got unsigned char [noderef] <asn:1>
*ubuf @@
fs/xfs/xfs_ioctl.c:476:13: sparse: expected void *
fs/xfs/xfs_ioctl.c:476:13: sparse: got unsigned char [noderef] <asn:1> *ubuf
fs/xfs/xfs_ioctl.c:531:13: sparse: sparse: incorrect type in argument 2 (different
address spaces) @@ expected void const * @@ got void [noderef] <asn:1> *arg
@@
fs/xfs/xfs_ioctl.c:531:13: sparse: expected void const *
fs/xfs/xfs_ioctl.c:531:13: sparse: got void [noderef] <asn:1> *arg
fs/xfs/xfs_ioctl.c:561:39: sparse: sparse: incorrect type in argument 2 (different
address spaces) @@ expected char const *src @@ got void [noderef] <asn:1>
*[usertype] am_attrname @@
fs/xfs/xfs_ioctl.c:561:39: sparse: expected char const *src
fs/xfs/xfs_ioctl.c:561:39: sparse: got void [noderef] <asn:1> *[usertype]
am_attrname
fs/xfs/xfs_ioctl.c:598:13: sparse: sparse: incorrect type in argument 1 (different
address spaces) @@ expected void * @@ got struct xfs_attr_multiop [noderef]
<asn:1> *[addressable] [usertype] ops @@
fs/xfs/xfs_ioctl.c:598:13: sparse: expected void *
fs/xfs/xfs_ioctl.c:598:13: sparse: got struct xfs_attr_multiop [noderef]
<asn:1> *[addressable] [usertype] ops
fs/xfs/xfs_ioctl.c:789:13: sparse: sparse: incorrect type in argument 2 (different
address spaces) @@ expected void const * @@ got void [noderef] <asn:1> *arg
@@
fs/xfs/xfs_ioctl.c:789:13: sparse: expected void const *
fs/xfs/xfs_ioctl.c:789:13: sparse: got void [noderef] <asn:1> *arg
fs/xfs/xfs_ioctl.c:792:13: sparse: sparse: incorrect type in argument 2 (different
address spaces) @@ expected void const * @@ got unsigned long long [noderef]
[usertype] <asn:1> *[addressable] [usertype] lastip @@
fs/xfs/xfs_ioctl.c:792:13: sparse: expected void const *
fs/xfs/xfs_ioctl.c:792:13: sparse: got unsigned long long [noderef] [usertype]
<asn:1> *[addressable] [usertype] lastip
fs/xfs/xfs_ioctl.c:816:21: sparse: sparse: incorrect type in argument 1 (different
address spaces) @@ expected void * @@ got unsigned long long [noderef] [usertype]
<asn:1> *[addressable] [usertype] lastip @@
fs/xfs/xfs_ioctl.c:816:21: sparse: expected void *
fs/xfs/xfs_ioctl.c:816:21: sparse: got unsigned long long [noderef] [usertype]
<asn:1> *[addressable] [usertype] lastip
fs/xfs/xfs_ioctl.c:820:21: sparse: sparse: incorrect type in argument 1 (different
address spaces) @@ expected void * @@ got signed int [noderef] [usertype]
<asn:1> *[addressable] [usertype] ocount @@
fs/xfs/xfs_ioctl.c:820:21: sparse: expected void *
fs/xfs/xfs_ioctl.c:820:21: sparse: got signed int [noderef] [usertype]
<asn:1> *[addressable] [usertype] ocount
fs/xfs/xfs_ioctl.c:844:13: sparse: sparse: incorrect type in argument 1 (different
address spaces) @@ expected void * @@ got void [noderef] <asn:1> *arg @@
fs/xfs/xfs_ioctl.c:844:13: sparse: expected void *
fs/xfs/xfs_ioctl.c:844:13: sparse: got void [noderef] <asn:1> *arg
fs/xfs/xfs_ioctl.c:861:13: sparse: sparse: incorrect type in argument 1 (different
address spaces) @@ expected void * @@ got void [noderef] <asn:1> *arg @@
fs/xfs/xfs_ioctl.c:861:13: sparse: expected void *
fs/xfs/xfs_ioctl.c:861:13: sparse: got void [noderef] <asn:1> *arg
fs/xfs/xfs_ioctl.c:953:13: sparse: sparse: incorrect type in argument 1 (different
address spaces) @@ expected void * @@ got void [noderef] <asn:1> *arg @@
fs/xfs/xfs_ioctl.c:953:13: sparse: expected void *
fs/xfs/xfs_ioctl.c:953:13: sparse: got void [noderef] <asn:1> *arg
fs/xfs/xfs_ioctl.c:1307:13: sparse: sparse: incorrect type in argument 2 (different
address spaces) @@ expected void const * @@ got void [noderef] <asn:1> *arg
@@
fs/xfs/xfs_ioctl.c:1307:13: sparse: expected void const *
fs/xfs/xfs_ioctl.c:1307:13: sparse: got void [noderef] <asn:1> *arg
fs/xfs/xfs_ioctl.c:1330:13: sparse: sparse: incorrect type in argument 1 (different
address spaces) @@ expected void * @@ got void [noderef] <asn:1> *arg @@
fs/xfs/xfs_ioctl.c:1330:13: sparse: expected void *
fs/xfs/xfs_ioctl.c:1330:13: sparse: got void [noderef] <asn:1> *arg
fs/xfs/xfs_ioctl.c:1346:13: sparse: sparse: incorrect type in argument 2 (different
address spaces) @@ expected void const * @@ got void [noderef] <asn:1> *arg
@@
fs/xfs/xfs_ioctl.c:1346:13: sparse: expected void const *
fs/xfs/xfs_ioctl.c:1346:13: sparse: got void [noderef] <asn:1> *arg
fs/xfs/xfs_ioctl.c:1373:13: sparse: sparse: incorrect type in argument 1 (different
address spaces) @@ expected void * @@ got struct getbmap [noderef] <asn:1>
*base @@
fs/xfs/xfs_ioctl.c:1373:13: sparse: expected void *
fs/xfs/xfs_ioctl.c:1373:13: sparse: got struct getbmap [noderef] <asn:1>
*base
fs/xfs/xfs_ioctl.c:1391:13: sparse: sparse: incorrect type in argument 2 (different
address spaces) @@ expected void const * @@ got void [noderef] <asn:1> *arg
@@
fs/xfs/xfs_ioctl.c:1391:13: sparse: expected void const *
fs/xfs/xfs_ioctl.c:1391:13: sparse: got void [noderef] <asn:1> *arg
fs/xfs/xfs_ioctl.c:1407:13: sparse: sparse: incorrect type in argument 1 (different
address spaces) @@ expected void * @@ got void [noderef] <asn:1> *arg @@
fs/xfs/xfs_ioctl.c:1407:13: sparse: expected void *
fs/xfs/xfs_ioctl.c:1407:13: sparse: got void [noderef] <asn:1> *arg
fs/xfs/xfs_ioctl.c:1417:13: sparse: sparse: incorrect type in argument 1 (different
address spaces) @@ expected void * @@ got struct getbmapx [noderef] <asn:1>
*base @@
fs/xfs/xfs_ioctl.c:1417:13: sparse: expected void *
fs/xfs/xfs_ioctl.c:1417:13: sparse: got struct getbmapx [noderef] <asn:1>
*base
fs/xfs/xfs_ioctl.c:1432:13: sparse: sparse: incorrect type in argument 2 (different
address spaces) @@ expected void const * @@ got void [noderef] <asn:1> *arg
@@
fs/xfs/xfs_ioctl.c:1432:13: sparse: expected void const *
fs/xfs/xfs_ioctl.c:1432:13: sparse: got void [noderef] <asn:1> *arg
fs/xfs/xfs_ioctl.c:1447:13: sparse: sparse: incorrect type in argument 1 (different
address spaces) @@ expected void * @@ got void [noderef] <asn:1> *arg @@
fs/xfs/xfs_ioctl.c:1447:13: sparse: expected void *
fs/xfs/xfs_ioctl.c:1447:13: sparse: got void [noderef] <asn:1> *arg
fs/xfs/xfs_ioctl.c:1560:21: sparse: sparse: incorrect type in argument 2 (different
address spaces) @@ expected void const * @@ got void [noderef] <asn:1> *arg
@@
fs/xfs/xfs_ioctl.c:1560:21: sparse: expected void const *
fs/xfs/xfs_ioctl.c:1560:21: sparse: got void [noderef] <asn:1> *arg
fs/xfs/xfs_ioctl.c:1573:21: sparse: sparse: incorrect type in argument 1 (different
address spaces) @@ expected void * @@ got void [noderef] <asn:1> *arg @@
fs/xfs/xfs_ioctl.c:1573:21: sparse: expected void *
fs/xfs/xfs_ioctl.c:1573:21: sparse: got void [noderef] <asn:1> *arg
fs/xfs/xfs_ioctl.c:1590:24: sparse: sparse: cast removes address space
'<asn:1>' of expression
fs/xfs/xfs_ioctl.c:1590:24: sparse: sparse: cast removes address space
'<asn:1>' of expression
fs/xfs/xfs_ioctl.c:1590:24: sparse: sparse: cast removes address space
'<asn:1>' of expression
fs/xfs/xfs_ioctl.c:1590:24: sparse: sparse: incorrect type in argument 1 (different
address spaces) @@ expected void * @@ got int [noderef] <asn:1> * @@
fs/xfs/xfs_ioctl.c:1590:24: sparse: expected void *
fs/xfs/xfs_ioctl.c:1590:24: sparse: got int [noderef] <asn:1> *
fs/xfs/xfs_ioctl.c:1606:21: sparse: sparse: incorrect type in argument 2 (different
address spaces) @@ expected void const * @@ got void [noderef] <asn:1> *arg
@@
fs/xfs/xfs_ioctl.c:1606:21: sparse: expected void const *
fs/xfs/xfs_ioctl.c:1606:21: sparse: got void [noderef] <asn:1> *arg
fs/xfs/xfs_ioctl.c:1631:21: sparse: sparse: incorrect type in argument 2 (different
address spaces) @@ expected void const * @@ got void [noderef] <asn:1> *arg
@@
fs/xfs/xfs_ioctl.c:1631:21: sparse: expected void const *
fs/xfs/xfs_ioctl.c:1631:21: sparse: got void [noderef] <asn:1> *arg
fs/xfs/xfs_ioctl.c:1638:21: sparse: sparse: incorrect type in argument 2 (different
address spaces) @@ expected void const * @@ got void [noderef] <asn:1> *arg
@@
fs/xfs/xfs_ioctl.c:1638:21: sparse: expected void const *
fs/xfs/xfs_ioctl.c:1638:21: sparse: got void [noderef] <asn:1> *arg
fs/xfs/xfs_ioctl.c:1648:21: sparse: sparse: incorrect type in argument 2 (different
address spaces) @@ expected void const * @@ got void [noderef] <asn:1> *arg
@@
fs/xfs/xfs_ioctl.c:1648:21: sparse: expected void const *
fs/xfs/xfs_ioctl.c:1648:21: sparse: got void [noderef] <asn:1> *arg
fs/xfs/xfs_ioctl.c:1661:21: sparse: sparse: incorrect type in argument 2 (different
address spaces) @@ expected void const * @@ got void [noderef] <asn:1> *arg
@@
fs/xfs/xfs_ioctl.c:1661:21: sparse: expected void const *
fs/xfs/xfs_ioctl.c:1661:21: sparse: got void [noderef] <asn:1> *arg
fs/xfs/xfs_ioctl.c:1678:21: sparse: sparse: incorrect type in argument 1 (different
address spaces) @@ expected void * @@ got void [noderef] <asn:1> *arg @@
fs/xfs/xfs_ioctl.c:1678:21: sparse: expected void *
fs/xfs/xfs_ioctl.c:1678:21: sparse: got void [noderef] <asn:1> *arg
fs/xfs/xfs_ioctl.c:1693:21: sparse: sparse: incorrect type in argument 2 (different
address spaces) @@ expected void const * @@ got void [noderef] <asn:1> *arg
@@
fs/xfs/xfs_ioctl.c:1693:21: sparse: expected void const *
fs/xfs/xfs_ioctl.c:1693:21: sparse: got void [noderef] <asn:1> *arg
fs/xfs/xfs_ioctl.c:1707:21: sparse: sparse: incorrect type in argument 1 (different
address spaces) @@ expected void * @@ got void [noderef] <asn:1> *arg @@
fs/xfs/xfs_ioctl.c:1707:21: sparse: expected void *
vim +440 fs/xfs/xfs_ioctl.c
399
400 STATIC int
401 xfs_attrlist_by_handle(
402 struct file *parfilp,
403 void __user *arg)
404 {
405 int error = -ENOMEM;
406 attrlist_cursor_kern_t *cursor;
407 struct xfs_fsop_attrlist_handlereq __user *p = arg;
408 xfs_fsop_attrlist_handlereq_t al_hreq;
409 struct dentry *dentry;
410 char *kbuf;
411
412 if (!capable(CAP_SYS_ADMIN))
413 return -EPERM;
414 if (copy_from_user(&al_hreq, arg, sizeof(xfs_fsop_attrlist_handlereq_t)))
415 return -EFAULT;
416 if (al_hreq.buflen < sizeof(struct attrlist) ||
417 al_hreq.buflen > XATTR_LIST_MAX)
418 return -EINVAL;
419
420 /*
421 * Reject flags, only allow namespaces.
422 */
423 if (al_hreq.flags & ~(ATTR_ROOT | ATTR_SECURE))
424 return -EINVAL;
425
426 dentry = xfs_handlereq_to_dentry(parfilp, &al_hreq.hreq);
427 if (IS_ERR(dentry))
428 return PTR_ERR(dentry);
429
430 kbuf = kmem_zalloc_large(al_hreq.buflen, KM_SLEEP);
431 if (!kbuf)
432 goto out_dput;
433
434 cursor = (attrlist_cursor_kern_t *)&al_hreq.pos;
435 error = xfs_attr_list(XFS_I(dentry->d_inode), kbuf, al_hreq.buflen,
436 al_hreq.flags, cursor);
437 if (error)
438 goto out_kfree;
439
440 if (copy_to_user(&p->pos, cursor,
sizeof(attrlist_cursor_kern_t))) {
441 error = -EFAULT;
442 goto out_kfree;
443 }
444
445 if (copy_to_user(al_hreq.buffer, kbuf, al_hreq.buflen))
446 error = -EFAULT;
447
448 out_kfree:
449 kmem_free(kbuf);
450 out_dput:
451 dput(dentry);
452 return error;
453 }
454
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org