linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [linux-next:master 10767/11658] drivers/staging/wlan-ng/p80211netdev.c:572:33: sparse: sparse: incorrect type in argument 1 (different address spaces)
@ 2021-02-18  8:55 kernel test robot
  2021-02-19  6:26 ` Ivan Safonov
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2021-02-18  8:55 UTC (permalink / raw)
  To: Ivan Safonov; +Cc: kbuild-all, Linux Memory Management List, Greg Kroah-Hartman

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   cd560d8023bf73c94d755908c8d4a0994dd1ec34
commit: bc4bf94cc2aed9192184782dbb9f884c5d6b9e82 [10767/11658] staging:wlan-ng: use memdup_user instead of kmalloc/copy_from_user
config: i386-randconfig-s001-20210218 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-215-g0fb77bb6-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=bc4bf94cc2aed9192184782dbb9f884c5d6b9e82
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout bc4bf94cc2aed9192184782dbb9f884c5d6b9e82
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

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


"sparse warnings: (new ones prefixed by >>)"
>> drivers/staging/wlan-ng/p80211netdev.c:572:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const [noderef] __user * @@     got char *[usertype] data @@
   drivers/staging/wlan-ng/p80211netdev.c:572:33: sparse:     expected void const [noderef] __user *
   drivers/staging/wlan-ng/p80211netdev.c:572:33: sparse:     got char *[usertype] data

vim +572 drivers/staging/wlan-ng/p80211netdev.c

   557	
   558		/* Test the magic, assume ifr is good if it's there */
   559		if (req->magic != P80211_IOCTL_MAGIC) {
   560			result = -EINVAL;
   561			goto bail;
   562		}
   563	
   564		if (cmd == P80211_IFTEST) {
   565			result = 0;
   566			goto bail;
   567		} else if (cmd != P80211_IFREQ) {
   568			result = -EINVAL;
   569			goto bail;
   570		}
   571	
 > 572		msgbuf = memdup_user(req->data, req->len);
   573		if (IS_ERR(msgbuf)) {
   574			result = PTR_ERR(msgbuf);
   575			goto bail;
   576		}
   577	
   578		result = p80211req_dorequest(wlandev, msgbuf);
   579	
   580		if (result == 0) {
   581			if (copy_to_user
   582			    ((void __user *)req->data, msgbuf, req->len)) {
   583				result = -EFAULT;
   584			}
   585		}
   586		kfree(msgbuf);
   587	
   588	bail:
   589		/* If allocate,copyfrom or copyto fails, return errno */
   590		return result;
   591	}
   592	

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

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-19  6:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-18  8:55 [linux-next:master 10767/11658] drivers/staging/wlan-ng/p80211netdev.c:572:33: sparse: sparse: incorrect type in argument 1 (different address spaces) kernel test robot
2021-02-19  6:26 ` Ivan Safonov
2021-02-19  6:35   ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).