linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* drivers/ide/ide-ioctls.c:15:24: sparse: sparse: incorrect type in initializer (different address spaces)
@ 2020-05-22 12:23 kbuild test robot
  2020-05-22 13:40 ` Arnd Bergmann
  0 siblings, 1 reply; 3+ messages in thread
From: kbuild test robot @ 2020-05-22 12:23 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: kbuild-all, linux-kernel, Ben Hutchings

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   051143e1602d90ea71887d92363edd539d411de5
commit: 1df23c6fe5b0654ece219985a0c32e40b100bd9a compat_ioctl: move HDIO ioctl handling into drivers/ide
date:   5 months ago
config: xtensa-randconfig-s002-20200522 (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-193-gb8fad4bc-dirty
        git checkout 1df23c6fe5b0654ece219985a0c32e40b100bd9a
        # save the attached .config to linux build tree
        make W=1 C=1 ARCH=xtensa CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

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


sparse warnings: (new ones prefixed by >>)

   ./arch/xtensa/include/generated/uapi/asm/unistd_32.h:391:41: sparse: sparse: no newline at end of file
>> drivers/ide/ide-ioctls.c:15:24: sparse: sparse: incorrect type in initializer (different address spaces) @@    expected signed int *__pu_addr @@    got signed int [noderef] [usertypsigned int *__pu_addr @@
>> drivers/ide/ide-ioctls.c:15:24: sparse:    expected signed int *__pu_addr
>> drivers/ide/ide-ioctls.c:15:24: sparse:    got signed int [noderef] [usertype] <asn:1> *
>> drivers/ide/ide-ioctls.c:15:24: sparse: sparse: incorrect type in argument 1 (different address spaces) @@    expected void [noderef] <asn:1> *to @@    got f] <asn:1> *to @@
   drivers/ide/ide-ioctls.c:15:24: sparse:    expected void [noderef] <asn:1> *to
>> drivers/ide/ide-ioctls.c:15:24: sparse:    got signed int *__pu_addr
   drivers/ide/ide-ioctls.c:17:16: sparse: sparse: incorrect type in initializer (different address spaces) @@    expected long *__pu_addr @@    got long [noderef] <aslong *__pu_addr @@
   drivers/ide/ide-ioctls.c:17:16: sparse:    expected long *__pu_addr
   drivers/ide/ide-ioctls.c:17:16: sparse:    got long [noderef] <asn:1> *
   drivers/ide/ide-ioctls.c:17:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@    expected void [noderef] <asn:1> *to @@    got n:1> *to @@
   drivers/ide/ide-ioctls.c:17:16: sparse:    expected void [noderef] <asn:1> *to
   drivers/ide/ide-ioctls.c:17:16: sparse:    got long *__pu_addr
   include/linux/ata.h:1101:34: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] @@    got resunsigned short [usertype] @@
   include/linux/ata.h:1101:34: sparse:    expected unsigned short [usertype]
   include/linux/ata.h:1101:34: sparse:    got restricted __le16 [usertype]
   include/linux/ata.h:1102:34: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] @@    got resunsigned short [usertype] @@
   include/linux/ata.h:1102:34: sparse:    expected unsigned short [usertype]
   include/linux/ata.h:1102:34: sparse:    got restricted __le16 [usertype]
   include/linux/ata.h:1103:34: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] @@    got resunsigned short [usertype] @@
   include/linux/ata.h:1103:34: sparse:    expected unsigned short [usertype]
   include/linux/ata.h:1103:34: sparse:    got restricted __le16 [usertype]
   include/linux/ata.h:1104:34: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] @@    got resunsigned short [usertype] @@
   include/linux/ata.h:1104:34: sparse:    expected unsigned short [usertype]
   include/linux/ata.h:1104:34: sparse:    got restricted __le16 [usertype]
   include/linux/ata.h:1105:34: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short [usertype] @@    got resunsigned short [usertype] @@
   include/linux/ata.h:1105:34: sparse:    expected unsigned short [usertype]
   include/linux/ata.h:1105:34: sparse:    got restricted __le16 [usertype]

vim +15 drivers/ide/ide-ioctls.c

    11	
    12	static int put_user_long(long val, unsigned long arg)
    13	{
    14		if (in_compat_syscall())
  > 15			return put_user(val, (compat_long_t __user *)compat_ptr(arg));
    16	
    17		return put_user(val, (long __user *)arg);
    18	}
    19	

---
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: 34001 bytes --]

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

* Re: drivers/ide/ide-ioctls.c:15:24: sparse: sparse: incorrect type in initializer (different address spaces)
  2020-05-22 12:23 drivers/ide/ide-ioctls.c:15:24: sparse: sparse: incorrect type in initializer (different address spaces) kbuild test robot
@ 2020-05-22 13:40 ` Arnd Bergmann
  2020-05-22 15:39   ` Al Viro
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2020-05-22 13:40 UTC (permalink / raw)
  To: kbuild test robot
  Cc: kbuild-all, linux-kernel, Ben Hutchings, Chris Zankel,
	Max Filippov, linux-xtensa

On Fri, May 22, 2020 at 2:24 PM kbuild test robot <lkp@intel.com> wrote:
>
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   051143e1602d90ea71887d92363edd539d411de5
> commit: 1df23c6fe5b0654ece219985a0c32e40b100bd9a compat_ioctl: move HDIO ioctl handling into drivers/ide
> date:   5 months ago
> config: xtensa-randconfig-s002-20200522 (attached as .config)
> compiler: xtensa-linux-gcc (GCC) 9.3.0
> reproduce:
>         # apt-get install sparse
>         # sparse version: v0.6.1-193-gb8fad4bc-dirty
>         git checkout 1df23c6fe5b0654ece219985a0c32e40b100bd9a
>         # save the attached .config to linux build tree
>         make W=1 C=1 ARCH=xtensa CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kbuild test robot <lkp@intel.com>
>
>
> sparse warnings: (new ones prefixed by >>)
>
>    ./arch/xtensa/include/generated/uapi/asm/unistd_32.h:391:41: sparse: sparse: no newline at end of file
> >> drivers/ide/ide-ioctls.c:15:24: sparse: sparse: incorrect type in initializer (different address spaces) @@    expected signed int *__pu_addr @@    got signed int [noderef] [usertypsigned int *__pu_addr @@
> >> drivers/ide/ide-ioctls.c:15:24: sparse:    expected signed int *__pu_addr
> >> drivers/ide/ide-ioctls.c:15:24: sparse:    got signed int [noderef] [usertype] <asn:1> *
> >> drivers/ide/ide-ioctls.c:15:24: sparse: sparse: incorrect type in argument 1 (different address spaces) @@    expected void [noderef] <asn:1> *to @@    got f] <asn:1> *to @@
>    drivers/ide/ide-ioctls.c:15:24: sparse:    expected void [noderef] <asn:1> *to
> >> drivers/ide/ide-ioctls.c:15:24: sparse:    got signed int *__pu_addr


I think this is a bug in the xtensa asm/uaccess.h, but I don't know why it
only showed up now.

>    drivers/ide/ide-ioctls.c:17:16: sparse: sparse: incorrect type in initializer (different address spaces) @@    expected long *__pu_addr @@    got long [noderef] <aslong *__pu_addr @@
>    drivers/ide/ide-ioctls.c:17:16: sparse:    expected long *__pu_addr
>    drivers/ide/ide-ioctls.c:17:16: sparse:    got long [noderef] <asn:1> *
>    drivers/ide/ide-ioctls.c:17:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@    expected void [noderef] <asn:1> *to @@    got n:1> *to @@
>    drivers/ide/ide-ioctls.c:17:16: sparse:    expected void [noderef] <asn:1> *to
>    drivers/ide/ide-ioctls.c:17:16: sparse:    got long *__pu_addr

This looks like an old bug in the ide driver, unrelated to my patch.

     Arnd

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

* Re: drivers/ide/ide-ioctls.c:15:24: sparse: sparse: incorrect type in initializer (different address spaces)
  2020-05-22 13:40 ` Arnd Bergmann
@ 2020-05-22 15:39   ` Al Viro
  0 siblings, 0 replies; 3+ messages in thread
From: Al Viro @ 2020-05-22 15:39 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: kbuild test robot, kbuild-all, linux-kernel, Ben Hutchings,
	Chris Zankel, Max Filippov, linux-xtensa

On Fri, May 22, 2020 at 03:40:50PM +0200, Arnd Bergmann wrote:
> On Fri, May 22, 2020 at 2:24 PM kbuild test robot <lkp@intel.com> wrote:
> >
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > head:   051143e1602d90ea71887d92363edd539d411de5
> > commit: 1df23c6fe5b0654ece219985a0c32e40b100bd9a compat_ioctl: move HDIO ioctl handling into drivers/ide
> > date:   5 months ago
> > config: xtensa-randconfig-s002-20200522 (attached as .config)
> > compiler: xtensa-linux-gcc (GCC) 9.3.0
> > reproduce:
> >         # apt-get install sparse
> >         # sparse version: v0.6.1-193-gb8fad4bc-dirty
> >         git checkout 1df23c6fe5b0654ece219985a0c32e40b100bd9a
> >         # save the attached .config to linux build tree
> >         make W=1 C=1 ARCH=xtensa CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
> >
> > If you fix the issue, kindly add following tag as appropriate
> > Reported-by: kbuild test robot <lkp@intel.com>
> >
> >
> > sparse warnings: (new ones prefixed by >>)
> >
> >    ./arch/xtensa/include/generated/uapi/asm/unistd_32.h:391:41: sparse: sparse: no newline at end of file
> > >> drivers/ide/ide-ioctls.c:15:24: sparse: sparse: incorrect type in initializer (different address spaces) @@    expected signed int *__pu_addr @@    got signed int [noderef] [usertypsigned int *__pu_addr @@
> > >> drivers/ide/ide-ioctls.c:15:24: sparse:    expected signed int *__pu_addr
> > >> drivers/ide/ide-ioctls.c:15:24: sparse:    got signed int [noderef] [usertype] <asn:1> *
> > >> drivers/ide/ide-ioctls.c:15:24: sparse: sparse: incorrect type in argument 1 (different address spaces) @@    expected void [noderef] <asn:1> *to @@    got f] <asn:1> *to @@
> >    drivers/ide/ide-ioctls.c:15:24: sparse:    expected void [noderef] <asn:1> *to
> > >> drivers/ide/ide-ioctls.c:15:24: sparse:    got signed int *__pu_addr
> 
> 
> I think this is a bug in the xtensa asm/uaccess.h, but I don't know why it
> only showed up now.

xtensa has no __user annotations in there.  At all.  So until somebody sits
down and does those, there will be such noise, reported every time somebody
changes a line with get_user() or put_user() anywhere in the tree.

As far as I'm concerned, __user-related reports on xtensa are to be ignored
for now.

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

end of thread, other threads:[~2020-05-22 15:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-22 12:23 drivers/ide/ide-ioctls.c:15:24: sparse: sparse: incorrect type in initializer (different address spaces) kbuild test robot
2020-05-22 13:40 ` Arnd Bergmann
2020-05-22 15:39   ` Al Viro

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