All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: kernel test robot <lkp@intel.com>
Cc: Christoph Hellwig <hch@lst.de>,
	kbuild-all@lists.01.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Greg Ungerer <gerg@linux-m68k.org>,
	linux-m68k@lists.linux-m68k.org
Subject: Re: [char-misc:char-misc-next 28/28] drivers/char/mem.c:737:21: sparse: sparse: incorrect type in argument 1 (different address spaces)
Date: Mon, 7 Sep 2020 08:24:56 +0200	[thread overview]
Message-ID: <20200907062456.GA19124@lst.de> (raw)
In-Reply-To: <202009060512.tOc1hWe8%lkp@intel.com>

On Sun, Sep 06, 2020 at 05:14:15AM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git char-misc-next
> head:   99f667352f6c938440d9043d0f66f859d6f3d50d
> commit: 99f667352f6c938440d9043d0f66f859d6f3d50d [28/28] /dev/zero: also implement ->read
> config: m68k-randconfig-s031-20200904 (attached as .config)
> compiler: m68k-linux-gcc (GCC) 9.3.0

Looks like m68 does not have proper __user annotations for clear_user..

> 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.2-191-g10164920-dirty
>         git checkout 99f667352f6c938440d9043d0f66f859d6f3d50d
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.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@intel.com>
> 
> 
> sparse warnings: (new ones prefixed by >>)
> 
>    drivers/char/mem.c:163:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *to @@     got char [noderef] __user *buf @@
>    drivers/char/mem.c:163:37: sparse:     expected void *to
>    drivers/char/mem.c:163:37: sparse:     got char [noderef] __user *buf
> >> drivers/char/mem.c:737:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *to @@     got char [noderef] __user * @@
>    drivers/char/mem.c:737:21: sparse:     expected void *to
> >> drivers/char/mem.c:737:21: sparse:     got char [noderef] __user *
> 
> # https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git/commit/?id=99f667352f6c938440d9043d0f66f859d6f3d50d
> git remote add char-misc https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
> git fetch --no-tags char-misc char-misc-next
> git checkout 99f667352f6c938440d9043d0f66f859d6f3d50d
> vim +737 drivers/char/mem.c
> 
>    728	
>    729	static ssize_t read_zero(struct file *file, char __user *buf,
>    730				 size_t count, loff_t *ppos)
>    731	{
>    732		size_t cleared = 0;
>    733	
>    734		while (count) {
>    735			size_t chunk = min_t(size_t, count, PAGE_SIZE);
>    736	
>  > 737			if (clear_user(buf + cleared, chunk))
>    738				return cleared ? cleared : -EFAULT;
>    739			cleared += chunk;
>    740			count -= chunk;
>    741	
>    742			if (signal_pending(current))
>    743				return cleared ? cleared : -ERESTARTSYS;
>    744			cond_resched();
>    745		}
>    746	
>    747		return cleared;
>    748	}
>    749	
> 
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org


---end quoted text---

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: kbuild-all@lists.01.org
Subject: Re: [char-misc:char-misc-next 28/28] drivers/char/mem.c:737:21: sparse: sparse: incorrect type in argument 1 (different address spaces)
Date: Mon, 07 Sep 2020 08:24:56 +0200	[thread overview]
Message-ID: <20200907062456.GA19124@lst.de> (raw)
In-Reply-To: <202009060512.tOc1hWe8%lkp@intel.com>

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

On Sun, Sep 06, 2020 at 05:14:15AM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git char-misc-next
> head:   99f667352f6c938440d9043d0f66f859d6f3d50d
> commit: 99f667352f6c938440d9043d0f66f859d6f3d50d [28/28] /dev/zero: also implement ->read
> config: m68k-randconfig-s031-20200904 (attached as .config)
> compiler: m68k-linux-gcc (GCC) 9.3.0

Looks like m68 does not have proper __user annotations for clear_user..

> 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.2-191-g10164920-dirty
>         git checkout 99f667352f6c938440d9043d0f66f859d6f3d50d
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.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@intel.com>
> 
> 
> sparse warnings: (new ones prefixed by >>)
> 
>    drivers/char/mem.c:163:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *to @@     got char [noderef] __user *buf @@
>    drivers/char/mem.c:163:37: sparse:     expected void *to
>    drivers/char/mem.c:163:37: sparse:     got char [noderef] __user *buf
> >> drivers/char/mem.c:737:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *to @@     got char [noderef] __user * @@
>    drivers/char/mem.c:737:21: sparse:     expected void *to
> >> drivers/char/mem.c:737:21: sparse:     got char [noderef] __user *
> 
> # https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git/commit/?id=99f667352f6c938440d9043d0f66f859d6f3d50d
> git remote add char-misc https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
> git fetch --no-tags char-misc char-misc-next
> git checkout 99f667352f6c938440d9043d0f66f859d6f3d50d
> vim +737 drivers/char/mem.c
> 
>    728	
>    729	static ssize_t read_zero(struct file *file, char __user *buf,
>    730				 size_t count, loff_t *ppos)
>    731	{
>    732		size_t cleared = 0;
>    733	
>    734		while (count) {
>    735			size_t chunk = min_t(size_t, count, PAGE_SIZE);
>    736	
>  > 737			if (clear_user(buf + cleared, chunk))
>    738				return cleared ? cleared : -EFAULT;
>    739			cleared += chunk;
>    740			count -= chunk;
>    741	
>    742			if (signal_pending(current))
>    743				return cleared ? cleared : -ERESTARTSYS;
>    744			cond_resched();
>    745		}
>    746	
>    747		return cleared;
>    748	}
>    749	
> 
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org


---end quoted text---

  reply	other threads:[~2020-09-07  6:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-05 21:14 [char-misc:char-misc-next 28/28] drivers/char/mem.c:737:21: sparse: sparse: incorrect type in argument 1 (different address spaces) kernel test robot
2020-09-07  6:24 ` Christoph Hellwig [this message]
2020-09-07  6:24   ` Christoph Hellwig
2020-09-07  7:04   ` Geert Uytterhoeven
2020-09-07  7:04     ` Geert Uytterhoeven
2020-09-07  7:14     ` Christoph Hellwig
2020-09-07  7:14       ` Christoph Hellwig
2020-09-08 13:06       ` Greg Ungerer
2020-09-08 13:06         ` Greg Ungerer

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=20200907062456.GA19124@lst.de \
    --to=hch@lst.de \
    --cc=gerg@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=lkp@intel.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 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.