public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>,
	Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: kbuild-all@lists.01.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: Fri, 28 Aug 2020 23:11:08 +0800	[thread overview]
Message-ID: <202008282201.7LYGms3m%lkp@intel.com> (raw)
In-Reply-To: <20200828085301.78423-1-luc.vanoostenryck@gmail.com>

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

Hi Luc,

I love your patch! Perhaps something to improve:

[auto build test WARNING on 9123e3a74ec7b934a4a099e98af6a61c2f80bbf5]

url:    https://github.com/0day-ci/linux/commits/Luc-Van-Oostenryck/sparse-use-static-inline-for-__chk_-user-io-_ptr/20200828-165431
base:    9123e3a74ec7b934a4a099e98af6a61c2f80bbf5
config: i386-randconfig-s002-20200828 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.2-191-g10164920-dirty
        # save the attached .config to linux build tree
        make W=1 C=1 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:338:9: sparse: sparse: cast removes address space '__user' of expression
>> arch/x86/kernel/signal.c:338: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:338:9: sparse:     expected void const volatile [noderef] __user *ptr
   arch/x86/kernel/signal.c:338:9: sparse:     got unsigned long long [usertype] *
   arch/x86/kernel/signal.c:338:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:338:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:338:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:338:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:338:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:338:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:338:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:338:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:338:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:398:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:398: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:398:9: sparse:     expected void const volatile [noderef] __user *ptr
   arch/x86/kernel/signal.c:398:9: sparse:     got unsigned long long [usertype] *
   arch/x86/kernel/signal.c:398:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:398:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:398:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:398:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:398:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:398:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:398:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:398:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:398:9: sparse: sparse: cast removes address space '__user' of expression

# https://github.com/0day-ci/linux/commit/7d01c91ac34a64f0177bc6d058cc50e805f59102
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Luc-Van-Oostenryck/sparse-use-static-inline-for-__chk_-user-io-_ptr/20200828-165431
git checkout 7d01c91ac34a64f0177bc6d058cc50e805f59102
vim +338 arch/x86/kernel/signal.c

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

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

  parent reply	other threads:[~2020-08-28 15:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-28  8:53 [PATCH] sparse: use static inline for __chk_{user,io}_ptr() Luc Van Oostenryck
2020-08-28 11:15 ` kernel test robot
2020-08-28 11:37 ` kernel test robot
2020-08-28 12:20 ` kernel test robot
2020-08-28 14:21 ` kernel test robot
2020-08-28 15:11 ` kernel test robot [this message]
2020-08-28 19:04 ` Miguel Ojeda
2020-08-28 20:15   ` Luc Van Oostenryck
2020-08-29  7:33     ` Miguel Ojeda
  -- strict thread matches above, loose matches on Subject: below --
2020-06-28  7:20 Luc Van Oostenryck
2020-06-29 17:12 ` kernel test robot
2020-06-29 18:08 ` kernel test robot
2020-06-29 18:37   ` Luc Van Oostenryck
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=202008282201.7LYGms3m%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luc.vanoostenryck@gmail.com \
    --cc=miguel.ojeda.sandonis@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