linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ivan Safonov <insafonov@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: kbuild-all@lists.01.org,
	Linux Memory Management List <linux-mm@kvack.org>,
	Pritthijit Nath <pritthijit.nath@icloud.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	kernel test robot <lkp@intel.com>
Subject: Re: [linux-next:master 10767/11658] drivers/staging/wlan-ng/p80211netdev.c:572:33: sparse: sparse: incorrect type in argument 1 (different address spaces)
Date: Fri, 19 Feb 2021 09:26:08 +0300	[thread overview]
Message-ID: <34f1b30f-e681-8035-7014-a4ae6c8dc8d9@gmail.com> (raw)
In-Reply-To: <202102181635.MjFPiL57-lkp@intel.com>

On 2/18/21 11:55 AM, kernel test robot wrote:
> 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>
> 

Greg, should I fix my patch?

Pritthijit Nath <pritthijit.nath at icloud.com> has already made a fix 
for this warning:
http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2021-February/150785.html

> 
> "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
> 


  reply	other threads:[~2021-02-19  6:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-18  8:55 kernel test robot
2021-02-19  6:26 ` Ivan Safonov [this message]
2021-02-19  6:35   ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=34f1b30f-e681-8035-7014-a4ae6c8dc8d9@gmail.com \
    --to=insafonov@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=pritthijit.nath@icloud.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox