mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Palmer Dabbelt <palmerdabbelt@google.com>
Subject: include/asm-generic/uaccess.h:287:16: sparse: sparse: incorrect type in argument 1 (different address spaces)
Date: Mon, 16 Aug 2021 06:21:22 +0800	[thread overview]
Message-ID: <202108160617.21Qh5bh3-lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   ecf93431963a95c0f475921101bedc0dd62ec96d
commit: 9530141455c968938a913d602a236c2a7b0322e1 riscv: Add ARCH_HAS_FORTIFY_SOURCE
date:   5 months ago
config: riscv-randconfig-s032-20210816 (attached as .config)
compiler: riscv64-linux-gcc (GCC) 11.2.0
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.3-348-gf0e6938b-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9530141455c968938a913d602a236c2a7b0322e1
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 9530141455c968938a913d602a236c2a7b0322e1
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=riscv 

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 >>)
   mm/maccess.c: note: in included file (through arch/riscv/include/asm/uaccess.h, include/linux/uaccess.h, include/linux/sched/task.h, ...):
>> include/asm-generic/uaccess.h:287:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected char const *p @@     got char const [noderef] __user *src @@
   include/asm-generic/uaccess.h:287:16: sparse:     expected char const *p
   include/asm-generic/uaccess.h:287:16: sparse:     got char const [noderef] __user *src
--
   mm/util.c:124:6: sparse: sparse: multiple definitions for function 'kmemdup'
   mm/util.c: note: in included file (through include/linux/string.h, include/linux/bitmap.h, include/linux/cpumask.h, ...):
   include/linux/fortify-string.h:262:23: sparse:  the previous one is here
   mm/util.c: note: in included file (through arch/riscv/include/asm/uaccess.h, include/linux/uaccess.h, include/linux/sched/task.h, ...):
>> include/asm-generic/uaccess.h:287:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected char const *p @@     got char const [noderef] __user *src @@
   include/asm-generic/uaccess.h:287:16: sparse:     expected char const *p
   include/asm-generic/uaccess.h:287:16: sparse:     got char const [noderef] __user *src
--
   fs/exec.c:422:31: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected char const [noderef] __user * @@     got void * @@
   fs/exec.c:422:31: sparse:     expected char const [noderef] __user *
   fs/exec.c:422:31: sparse:     got void *
   fs/exec.c:879:35: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __user *to @@     got void * @@
   fs/exec.c:879:35: sparse:     expected void [noderef] __user *to
   fs/exec.c:879:35: sparse:     got void *
   fs/exec.c:1041:48: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected struct sighand_struct *oldsighand @@     got struct sighand_struct [noderef] __rcu *sighand @@
   fs/exec.c:1041:48: sparse:     expected struct sighand_struct *oldsighand
   fs/exec.c:1041:48: sparse:     got struct sighand_struct [noderef] __rcu *sighand
   fs/exec.c:1148:56: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected struct task_struct *parent @@     got struct task_struct [noderef] __rcu *parent @@
   fs/exec.c:1148:56: sparse:     expected struct task_struct *parent
   fs/exec.c:1148:56: sparse:     got struct task_struct [noderef] __rcu *parent
   fs/exec.c:1183:47: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected struct sighand_struct *oldsighand @@     got struct sighand_struct [noderef] __rcu *sighand @@
   fs/exec.c:1183:47: sparse:     expected struct sighand_struct *oldsighand
   fs/exec.c:1183:47: sparse:     got struct sighand_struct [noderef] __rcu *sighand
   fs/exec.c:1752:70: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct task_struct *tsk @@     got struct task_struct [noderef] __rcu *parent @@
   fs/exec.c:1752:70: sparse:     expected struct task_struct *tsk
   fs/exec.c:1752:70: sparse:     got struct task_struct [noderef] __rcu *parent
   fs/exec.c: note: in included file (through arch/riscv/include/asm/uaccess.h, include/linux/uaccess.h, include/linux/sched/task.h, ...):
>> include/asm-generic/uaccess.h:287:16: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected char const *p @@     got char const [noderef] __user *src @@
   include/asm-generic/uaccess.h:287:16: sparse:     expected char const *p
   include/asm-generic/uaccess.h:287:16: sparse:     got char const [noderef] __user *src

vim +287 include/asm-generic/uaccess.h

7f509a9ef7af0d GuanXuetao     2011-01-15  277  
830f5800acae17 Mark Salter    2011-10-04  278  /*
830f5800acae17 Mark Salter    2011-10-04  279   * Unlike strnlen, strnlen_user includes the nul terminator in
830f5800acae17 Mark Salter    2011-10-04  280   * its returned count. Callers should check for a returned value
830f5800acae17 Mark Salter    2011-10-04  281   * greater than N as an indication the string is too long.
830f5800acae17 Mark Salter    2011-10-04  282   */
eed417ddd52146 Arnd Bergmann  2009-05-13  283  static inline long strnlen_user(const char __user *src, long n)
eed417ddd52146 Arnd Bergmann  2009-05-13  284  {
96d4f267e40f95 Linus Torvalds 2019-01-03  285  	if (!access_ok(src, 1))
9844813f226f6d Mike Frysinger 2009-06-14  286  		return 0;
7f509a9ef7af0d GuanXuetao     2011-01-15 @287  	return __strnlen_user(src, n);
eed417ddd52146 Arnd Bergmann  2009-05-13  288  }
eed417ddd52146 Arnd Bergmann  2009-05-13  289  

:::::: The code at line 287 was first introduced by commit
:::::: 7f509a9ef7af0d6ac852d49eb87ed2b9857821cc asm-generic headers: add arch-specific __strnlen_user calling in uaccess.h

:::::: TO: GuanXuetao <gxt@mprc.pku.edu.cn>
:::::: CC: GuanXuetao <gxt@mprc.pku.edu.cn>

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

                 reply	other threads:[~2021-08-15 22:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202108160617.21Qh5bh3-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=palmerdabbelt@google.com \
    --cc=wangkefeng.wang@huawei.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

all inboxes | Powered by JetHome®