public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
* Re: [char-misc:char-misc-next 28/28] drivers/char/mem.c:737:21: sparse: sparse: incorrect type in argument 1 (different address spaces)
       [not found] <202009060512.tOc1hWe8%lkp@intel.com>
@ 2020-09-07  6:24 ` Christoph Hellwig
  2020-09-07  7:04   ` Geert Uytterhoeven
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2020-09-07  6:24 UTC (permalink / raw)
  To: kernel test robot
  Cc: Christoph Hellwig, kbuild-all, Greg Kroah-Hartman, Greg Ungerer,
	linux-m68k

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

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

* Re: [char-misc:char-misc-next 28/28] drivers/char/mem.c:737:21: sparse: sparse: incorrect type in argument 1 (different address spaces)
  2020-09-07  6:24 ` [char-misc:char-misc-next 28/28] drivers/char/mem.c:737:21: sparse: sparse: incorrect type in argument 1 (different address spaces) Christoph Hellwig
@ 2020-09-07  7:04   ` Geert Uytterhoeven
  2020-09-07  7:14     ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2020-09-07  7:04 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: kernel test robot, kbuild-all, Greg Kroah-Hartman, Greg Ungerer,
	linux-m68k

Hi Christoph,

On Mon, Sep 7, 2020 at 8:25 AM Christoph Hellwig <hch@lst.de> wrote:
> 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..

M68k has, m68knommu apparently hasn't.
Same for strncpy_from_user() and strnlen_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 *

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [char-misc:char-misc-next 28/28] drivers/char/mem.c:737:21: sparse: sparse: incorrect type in argument 1 (different address spaces)
  2020-09-07  7:04   ` Geert Uytterhoeven
@ 2020-09-07  7:14     ` Christoph Hellwig
  2020-09-08 13:06       ` Greg Ungerer
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2020-09-07  7:14 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Christoph Hellwig, kernel test robot, kbuild-all,
	Greg Kroah-Hartman, Greg Ungerer, linux-m68k

On Mon, Sep 07, 2020 at 09:04:15AM +0200, Geert Uytterhoeven wrote:
> Hi Christoph,
> 
> On Mon, Sep 7, 2020 at 8:25 AM Christoph Hellwig <hch@lst.de> wrote:
> > 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..
> 
> M68k has, m68knommu apparently hasn't.
> Same for strncpy_from_user() and strnlen_user().

Sorry, I mean to write m68knommu, that's why I added Greg to the
Cc list.

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

* Re: [char-misc:char-misc-next 28/28] drivers/char/mem.c:737:21: sparse: sparse: incorrect type in argument 1 (different address spaces)
  2020-09-07  7:14     ` Christoph Hellwig
@ 2020-09-08 13:06       ` Greg Ungerer
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Ungerer @ 2020-09-08 13:06 UTC (permalink / raw)
  To: Christoph Hellwig, Geert Uytterhoeven
  Cc: kernel test robot, kbuild-all, Greg Kroah-Hartman, linux-m68k


On 7/9/20 5:14 pm, Christoph Hellwig wrote:
> On Mon, Sep 07, 2020 at 09:04:15AM +0200, Geert Uytterhoeven wrote:
>> Hi Christoph,
>>
>> On Mon, Sep 7, 2020 at 8:25 AM Christoph Hellwig <hch@lst.de> wrote:
>>> 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..
>>
>> M68k has, m68knommu apparently hasn't.
>> Same for strncpy_from_user() and strnlen_user().
> 
> Sorry, I mean to write m68knommu, that's why I added Greg to the
> Cc list.

Yep, needs fixing. Will send a patch.

Thanks
Greg



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

end of thread, other threads:[~2020-09-08 17:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <202009060512.tOc1hWe8%lkp@intel.com>
2020-09-07  6:24 ` [char-misc:char-misc-next 28/28] drivers/char/mem.c:737:21: sparse: sparse: incorrect type in argument 1 (different address spaces) Christoph Hellwig
2020-09-07  7:04   ` Geert Uytterhoeven
2020-09-07  7:14     ` Christoph Hellwig
2020-09-08 13:06       ` Greg Ungerer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox