linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: kbuild test robot <lkp@intel.com>
Cc: kbuild-all@lists.01.org, linux-fsdevel@vger.kernel.org,
	Catalin Marinas <catalin.marinas@arm.com>
Subject: Re: [vfs:uaccess.net 16/19] net/atm/ioctl.c:180:29: sparse: sparse: Using plain integer as NULL pointer
Date: Fri, 22 May 2020 15:23:21 +0100	[thread overview]
Message-ID: <20200522142321.GP23230@ZenIV.linux.org.uk> (raw)
In-Reply-To: <202005222158.Heq0Iqum%lkp@intel.com>

On Fri, May 22, 2020 at 09:58:00PM +0800, kbuild test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git uaccess.net
> head:   0edecc020b33f8e31d8baa80735b45e8e8434700
> commit: a3929484af75ee524419edbbc4e9ce012c3d67c9 [16/19] atm: move copyin from atm_getnames() into the caller
> config: arm64-randconfig-s002-20200521 (attached as .config)
> compiler: aarch64-linux-gcc (GCC) 9.3.0
> reproduce:
>         # apt-get install sparse
>         # sparse version: v0.6.1-193-gb8fad4bc-dirty
>         git checkout a3929484af75ee524419edbbc4e9ce012c3d67c9
>         # save the attached .config to linux build tree
>         make W=1 C=1 ARCH=arm64 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 >>)
> 
> >> net/atm/ioctl.c:180:29: sparse: sparse: Using plain integer as NULL pointer

Huh?

>  > 180				if (get_user(buf, &iobuf->buffer))

_what_ use of plain integer as a NULL pointer?  <looks>
Misannotated get_user() on arm64 - should be
diff --git a/arch/arm64/include/asm/uaccess.h b/arch/arm64/include/asm/uaccess.h
index 32fc8061aa76..bc5c7b091152 100644
--- a/arch/arm64/include/asm/uaccess.h
+++ b/arch/arm64/include/asm/uaccess.h
@@ -304,7 +304,7 @@ do {									\
 		__p = uaccess_mask_ptr(__p);				\
 		__raw_get_user((x), __p, (err));			\
 	} else {							\
-		(x) = 0; (err) = -EFAULT;				\
+		(x) = (__force __typeof__(x))0; (err) = -EFAULT;	\
 	}								\
 } while (0)
 
and that's a _lot_ of noise in sparse logs on arm64, obviously - one for
each get_user() of a pointer...

  reply	other threads:[~2020-05-22 14:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-22 13:58 [vfs:uaccess.net 16/19] net/atm/ioctl.c:180:29: sparse: sparse: Using plain integer as NULL pointer kbuild test robot
2020-05-22 14:23 ` Al Viro [this message]
2020-05-22 14:44   ` Catalin Marinas
2020-05-22 15:04     ` Al Viro

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=20200522142321.GP23230@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=catalin.marinas@arm.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-fsdevel@vger.kernel.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 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).