lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202208051104.7NeIlCzj-lkp@intel.com>
Date:   Fri, 5 Aug 2022 11:14:05 +0800
From:   kernel test robot <lkp@...el.com>
To:     Dylan Yudaken <dylany@...com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Jens Axboe <axboe@...nel.dk>
Subject: io_uring/net.c:564:44: sparse: sparse: incorrect type in assignment
 (different address spaces)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   31be1d0fbd950395701d9fd47d8fb1f99c996f61
commit: 9bb66906f23e50d6db1e11f7498b72dfca1982a2 io_uring: support multishot in recvmsg
date:   11 days ago
config: alpha-randconfig-s043-20220804 (https://download.01.org/0day-ci/archive/20220805/202208051104.7NeIlCzj-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 12.1.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.4-39-gce1a6720-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9bb66906f23e50d6db1e11f7498b72dfca1982a2
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 9bb66906f23e50d6db1e11f7498b72dfca1982a2
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=alpha SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@...el.com>

sparse warnings: (new ones prefixed by >>)
   io_uring/net.c: note: in included file (through io_uring/io_uring.h):
   io_uring/slist.h:138:29: sparse: sparse: no newline at end of file
>> io_uring/net.c:564:44: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void [noderef] __user *msg_control_user @@     got void * @@
   io_uring/net.c:564:44: sparse:     expected void [noderef] __user *msg_control_user
   io_uring/net.c:564:44: sparse:     got void *
>> io_uring/net.c:569:14: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void [noderef] __user * @@     got void * @@
   io_uring/net.c:569:14: sparse:     expected void [noderef] __user *
   io_uring/net.c:569:14: sparse:     got void *

vim +564 io_uring/net.c

   548	
   549	static int io_recvmsg_prep_multishot(struct io_async_msghdr *kmsg,
   550					     struct io_sr_msg *sr, void __user **buf,
   551					     size_t *len)
   552	{
   553		unsigned long ubuf = (unsigned long) *buf;
   554		unsigned long hdr;
   555	
   556		hdr = sizeof(struct io_uring_recvmsg_out) + kmsg->namelen +
   557			kmsg->controllen;
   558		if (*len < hdr)
   559			return -EFAULT;
   560	
   561		if (kmsg->controllen) {
   562			unsigned long control = ubuf + hdr - kmsg->controllen;
   563	
 > 564			kmsg->msg.msg_control_user = (void *) control;
   565			kmsg->msg.msg_controllen = kmsg->controllen;
   566		}
   567	
   568		sr->buf = *buf; /* stash for later copy */
 > 569		*buf = (void *) (ubuf + hdr);
   570		kmsg->payloadlen = *len = *len - hdr;
   571		return 0;
   572	}
   573	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ