linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: kbuild-all@lists.01.org,
	Linux Memory Management List <linux-mm@kvack.org>,
	linux-kernel@vger.kernel.org,
	Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: Re: [PATCH] sparse: use static inline for __chk_{user,io}_ptr()
Date: Tue, 30 Jun 2020 01:12:50 +0800	[thread overview]
Message-ID: <202006300100.ATfFHBBj%lkp@intel.com> (raw)
In-Reply-To: <20200628072019.67107-1-luc.vanoostenryck@gmail.com>

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

Hi Luc,

I love your patch! Perhaps something to improve:

[auto build test WARNING on next-20200626]
[cannot apply to linux/master linus/master v5.8-rc2 v5.8-rc1 v5.7 v5.8-rc3]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use  as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Luc-Van-Oostenryck/sparse-use-static-inline-for-__chk_-user-io-_ptr/20200628-152401
base:    36e3135df4d426612fc77db26a312c2531108603
config: i386-randconfig-s001-20200629 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.2-3-gfa153962-dirty
        # save the attached .config to linux build tree
        make W=1 C= 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>


sparse warnings: (new ones prefixed by >>)

   arch/x86/kernel/signal.c:337:9: sparse: sparse: cast removes address space '__user' of expression
>> arch/x86/kernel/signal.c:337:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned long long [usertype] * @@
>> arch/x86/kernel/signal.c:337:9: sparse:     expected void const volatile [noderef] __user *ptr
   arch/x86/kernel/signal.c:337:9: sparse:     got unsigned long long [usertype] *
   arch/x86/kernel/signal.c:337:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:337:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:337:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:337:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:337:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:337:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:337:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:337:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:337:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:397:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:397:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned long long [usertype] * @@
   arch/x86/kernel/signal.c:397:9: sparse:     expected void const volatile [noderef] __user *ptr
   arch/x86/kernel/signal.c:397:9: sparse:     got unsigned long long [usertype] *
   arch/x86/kernel/signal.c:397:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:397:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:397:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:397:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:397:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:397:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:397:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:397:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:397:9: sparse: sparse: cast removes address space '__user' of expression

vim +337 arch/x86/kernel/signal.c

75779f05264b99 arch/x86/kernel/signal.c    Hiroshi Shimamoto 2009-02-27  302  
7e907f48980d66 arch/x86/kernel/signal_32.c Ingo Molnar       2008-03-06  303  static int
235b80226b986d arch/x86/kernel/signal.c    Al Viro           2012-11-09  304  __setup_frame(int sig, struct ksignal *ksig, sigset_t *set,
7e907f48980d66 arch/x86/kernel/signal_32.c Ingo Molnar       2008-03-06  305  	      struct pt_regs *regs)
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  306  {
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  307  	struct sigframe __user *frame;
7e907f48980d66 arch/x86/kernel/signal_32.c Ingo Molnar       2008-03-06  308  	void __user *restorer;
b00d8f8f0b2b39 arch/x86/kernel/signal.c    Al Viro           2020-02-15  309  	void __user *fp = NULL;
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  310  
b00d8f8f0b2b39 arch/x86/kernel/signal.c    Al Viro           2020-02-15  311  	frame = get_sigframe(&ksig->ka, regs, sizeof(*frame), &fp);
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  312  
5c1f178094631e arch/x86/kernel/signal.c    Al Viro           2020-02-15  313  	if (!user_access_begin(frame, sizeof(*frame)))
3d0aedd9538e6b arch/x86/kernel/signal_32.c Hiroshi Shimamoto 2008-09-12  314  		return -EFAULT;
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  315  
5c1f178094631e arch/x86/kernel/signal.c    Al Viro           2020-02-15  316  	unsafe_put_user(sig, &frame->sig, Efault);
b00d8f8f0b2b39 arch/x86/kernel/signal.c    Al Viro           2020-02-15  317  	unsafe_put_sigcontext(&frame->sc, fp, regs, set, Efault);
5c1f178094631e arch/x86/kernel/signal.c    Al Viro           2020-02-15  318  	unsafe_put_user(set->sig[1], &frame->extramask[0], Efault);
1a3e4ca41c5a38 arch/x86/kernel/signal_32.c Roland McGrath    2008-04-09  319  	if (current->mm->context.vdso)
6f121e548f8367 arch/x86/kernel/signal.c    Andy Lutomirski   2014-05-05  320  		restorer = current->mm->context.vdso +
0a6d1fa0d2b48f arch/x86/kernel/signal.c    Andy Lutomirski   2015-10-05  321  			vdso_image_32.sym___kernel_sigreturn;
9fbbd4dd17d071 arch/i386/kernel/signal.c   Andi Kleen        2007-02-13  322  	else
ade1af77129dea arch/x86/kernel/signal_32.c Jan Engelhardt    2008-01-30  323  		restorer = &frame->retcode;
235b80226b986d arch/x86/kernel/signal.c    Al Viro           2012-11-09  324  	if (ksig->ka.sa.sa_flags & SA_RESTORER)
235b80226b986d arch/x86/kernel/signal.c    Al Viro           2012-11-09  325  		restorer = ksig->ka.sa.sa_restorer;
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  326  
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  327  	/* Set up to return from userspace.  */
5c1f178094631e arch/x86/kernel/signal.c    Al Viro           2020-02-15  328  	unsafe_put_user(restorer, &frame->pretcode, Efault);
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  329  
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  330  	/*
7e907f48980d66 arch/x86/kernel/signal_32.c Ingo Molnar       2008-03-06  331  	 * This is popl %eax ; movl $__NR_sigreturn, %eax ; int $0x80
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  332  	 *
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  333  	 * WE DO NOT USE IT ANY MORE! It's only left here for historical
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  334  	 * reasons and because gdb uses it as a signature to notice
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  335  	 * signal handler stack frames.
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  336  	 */
5c1f178094631e arch/x86/kernel/signal.c    Al Viro           2020-02-15 @337  	unsafe_put_user(*((u64 *)&retcode), (u64 *)frame->retcode, Efault);
5c1f178094631e arch/x86/kernel/signal.c    Al Viro           2020-02-15  338  	user_access_end();
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  339  
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  340  	/* Set up registers for signal handler */
65ea5b03499035 arch/x86/kernel/signal_32.c H. Peter Anvin    2008-01-30  341  	regs->sp = (unsigned long)frame;
235b80226b986d arch/x86/kernel/signal.c    Al Viro           2012-11-09  342  	regs->ip = (unsigned long)ksig->ka.sa.sa_handler;
65ea5b03499035 arch/x86/kernel/signal_32.c H. Peter Anvin    2008-01-30  343  	regs->ax = (unsigned long)sig;
92bc2056855b32 arch/x86/kernel/signal_32.c Harvey Harrison   2008-02-08  344  	regs->dx = 0;
92bc2056855b32 arch/x86/kernel/signal_32.c Harvey Harrison   2008-02-08  345  	regs->cx = 0;
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  346  
65ea5b03499035 arch/x86/kernel/signal_32.c H. Peter Anvin    2008-01-30  347  	regs->ds = __USER_DS;
65ea5b03499035 arch/x86/kernel/signal_32.c H. Peter Anvin    2008-01-30  348  	regs->es = __USER_DS;
65ea5b03499035 arch/x86/kernel/signal_32.c H. Peter Anvin    2008-01-30  349  	regs->ss = __USER_DS;
65ea5b03499035 arch/x86/kernel/signal_32.c H. Peter Anvin    2008-01-30  350  	regs->cs = __USER_CS;
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  351  
283828f3c19ceb arch/i386/kernel/signal.c   David Howells     2006-01-18  352  	return 0;
b00d8f8f0b2b39 arch/x86/kernel/signal.c    Al Viro           2020-02-15  353  
b00d8f8f0b2b39 arch/x86/kernel/signal.c    Al Viro           2020-02-15  354  Efault:
b00d8f8f0b2b39 arch/x86/kernel/signal.c    Al Viro           2020-02-15  355  	user_access_end();
b00d8f8f0b2b39 arch/x86/kernel/signal.c    Al Viro           2020-02-15  356  	return -EFAULT;
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  357  }
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  358  

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

       reply	other threads:[~2020-06-29 17:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200628072019.67107-1-luc.vanoostenryck@gmail.com>
2020-06-29 17:12 ` kernel test robot [this message]
2020-06-29 18:08 ` kernel test robot
2020-06-30 11:58 ` kernel test robot
2020-07-01 18:35 ` kernel test robot

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=202006300100.ATfFHBBj%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=luc.vanoostenryck@gmail.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