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 19:37:50 +0800 [thread overview]
Message-ID: <202008281918.2rxxINLK%lkp@intel.com> (raw)
In-Reply-To: <20200828085301.78423-1-luc.vanoostenryck@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 6388 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: arc-randconfig-s031-20200828 (attached as .config)
compiler: arceb-elf-gcc (GCC) 9.3.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.2-191-g10164920-dirty
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=arc
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/arc/kernel/process.c:70:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user *ptr @@ got int *uaddr @@
>> arch/arc/kernel/process.c:70:15: sparse: expected void const volatile [noderef] __user *ptr
arch/arc/kernel/process.c:70:15: sparse: got int *uaddr
arch/arc/kernel/process.c:77:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user *ptr @@ got int *uaddr @@
arch/arc/kernel/process.c:77:15: sparse: expected void const volatile [noderef] __user *ptr
arch/arc/kernel/process.c:77:15: sparse: got int *uaddr
# 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 +70 arch/arc/kernel/process.c
bf90e1eab682dcb Vineet Gupta 2013-01-18 45
91e040a79df73d3 Vineet Gupta 2016-10-20 46 SYSCALL_DEFINE3(arc_usr_cmpxchg, int *, uaddr, int, expected, int, new)
91e040a79df73d3 Vineet Gupta 2016-10-20 47 {
e6e335bf3a400bc Vineet Gupta 2016-11-07 48 struct pt_regs *regs = current_pt_regs();
e8708786d4fe21c Peter Zijlstra 2018-06-19 49 u32 uval;
e8708786d4fe21c Peter Zijlstra 2018-06-19 50 int ret;
91e040a79df73d3 Vineet Gupta 2016-10-20 51
91e040a79df73d3 Vineet Gupta 2016-10-20 52 /*
91e040a79df73d3 Vineet Gupta 2016-10-20 53 * This is only for old cores lacking LLOCK/SCOND, which by defintion
91e040a79df73d3 Vineet Gupta 2016-10-20 54 * can't possibly be SMP. Thus doesn't need to be SMP safe.
91e040a79df73d3 Vineet Gupta 2016-10-20 55 * And this also helps reduce the overhead for serializing in
91e040a79df73d3 Vineet Gupta 2016-10-20 56 * the UP case
91e040a79df73d3 Vineet Gupta 2016-10-20 57 */
91e040a79df73d3 Vineet Gupta 2016-10-20 58 WARN_ON_ONCE(IS_ENABLED(CONFIG_SMP));
91e040a79df73d3 Vineet Gupta 2016-10-20 59
e6e335bf3a400bc Vineet Gupta 2016-11-07 60 /* Z indicates to userspace if operation succeded */
e6e335bf3a400bc Vineet Gupta 2016-11-07 61 regs->status32 &= ~STATUS_Z_MASK;
e6e335bf3a400bc Vineet Gupta 2016-11-07 62
96d4f267e40f950 Linus Torvalds 2019-01-03 63 ret = access_ok(uaddr, sizeof(*uaddr));
e8708786d4fe21c Peter Zijlstra 2018-06-19 64 if (!ret)
e8708786d4fe21c Peter Zijlstra 2018-06-19 65 goto fail;
91e040a79df73d3 Vineet Gupta 2016-10-20 66
e8708786d4fe21c Peter Zijlstra 2018-06-19 67 again:
91e040a79df73d3 Vineet Gupta 2016-10-20 68 preempt_disable();
91e040a79df73d3 Vineet Gupta 2016-10-20 69
e8708786d4fe21c Peter Zijlstra 2018-06-19 @70 ret = __get_user(uval, uaddr);
e8708786d4fe21c Peter Zijlstra 2018-06-19 71 if (ret)
e8708786d4fe21c Peter Zijlstra 2018-06-19 72 goto fault;
e8708786d4fe21c Peter Zijlstra 2018-06-19 73
e8708786d4fe21c Peter Zijlstra 2018-06-19 74 if (uval != expected)
e8708786d4fe21c Peter Zijlstra 2018-06-19 75 goto out;
e8708786d4fe21c Peter Zijlstra 2018-06-19 76
e8708786d4fe21c Peter Zijlstra 2018-06-19 77 ret = __put_user(new, uaddr);
e8708786d4fe21c Peter Zijlstra 2018-06-19 78 if (ret)
e8708786d4fe21c Peter Zijlstra 2018-06-19 79 goto fault;
91e040a79df73d3 Vineet Gupta 2016-10-20 80
e6e335bf3a400bc Vineet Gupta 2016-11-07 81 regs->status32 |= STATUS_Z_MASK;
91e040a79df73d3 Vineet Gupta 2016-10-20 82
e8708786d4fe21c Peter Zijlstra 2018-06-19 83 out:
91e040a79df73d3 Vineet Gupta 2016-10-20 84 preempt_enable();
e6e335bf3a400bc Vineet Gupta 2016-11-07 85 return uval;
e8708786d4fe21c Peter Zijlstra 2018-06-19 86
e8708786d4fe21c Peter Zijlstra 2018-06-19 87 fault:
e8708786d4fe21c Peter Zijlstra 2018-06-19 88 preempt_enable();
e8708786d4fe21c Peter Zijlstra 2018-06-19 89
e8708786d4fe21c Peter Zijlstra 2018-06-19 90 if (unlikely(ret != -EFAULT))
e8708786d4fe21c Peter Zijlstra 2018-06-19 91 goto fail;
e8708786d4fe21c Peter Zijlstra 2018-06-19 92
d8ed45c5dcd455f Michel Lespinasse 2020-06-08 93 mmap_read_lock(current->mm);
64019a2e467a288 Peter Xu 2020-08-11 94 ret = fixup_user_fault(current->mm, (unsigned long) uaddr,
e8708786d4fe21c Peter Zijlstra 2018-06-19 95 FAULT_FLAG_WRITE, NULL);
d8ed45c5dcd455f Michel Lespinasse 2020-06-08 96 mmap_read_unlock(current->mm);
e8708786d4fe21c Peter Zijlstra 2018-06-19 97
e8708786d4fe21c Peter Zijlstra 2018-06-19 98 if (likely(!ret))
e8708786d4fe21c Peter Zijlstra 2018-06-19 99 goto again;
e8708786d4fe21c Peter Zijlstra 2018-06-19 100
e8708786d4fe21c Peter Zijlstra 2018-06-19 101 fail:
3cf5d076fb4d489 Eric W. Biederman 2019-05-23 102 force_sig(SIGSEGV);
e8708786d4fe21c Peter Zijlstra 2018-06-19 103 return ret;
91e040a79df73d3 Vineet Gupta 2016-10-20 104 }
91e040a79df73d3 Vineet Gupta 2016-10-20 105
---
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: 30133 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH] sparse: use static inline for __chk_{user, io}_ptr()
Date: Fri, 28 Aug 2020 19:37:50 +0800 [thread overview]
Message-ID: <202008281918.2rxxINLK%lkp@intel.com> (raw)
In-Reply-To: <20200828085301.78423-1-luc.vanoostenryck@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 6492 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: arc-randconfig-s031-20200828 (attached as .config)
compiler: arceb-elf-gcc (GCC) 9.3.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.2-191-g10164920-dirty
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=arc
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/arc/kernel/process.c:70:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user *ptr @@ got int *uaddr @@
>> arch/arc/kernel/process.c:70:15: sparse: expected void const volatile [noderef] __user *ptr
arch/arc/kernel/process.c:70:15: sparse: got int *uaddr
arch/arc/kernel/process.c:77:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user *ptr @@ got int *uaddr @@
arch/arc/kernel/process.c:77:15: sparse: expected void const volatile [noderef] __user *ptr
arch/arc/kernel/process.c:77:15: sparse: got int *uaddr
# 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 +70 arch/arc/kernel/process.c
bf90e1eab682dcb Vineet Gupta 2013-01-18 45
91e040a79df73d3 Vineet Gupta 2016-10-20 46 SYSCALL_DEFINE3(arc_usr_cmpxchg, int *, uaddr, int, expected, int, new)
91e040a79df73d3 Vineet Gupta 2016-10-20 47 {
e6e335bf3a400bc Vineet Gupta 2016-11-07 48 struct pt_regs *regs = current_pt_regs();
e8708786d4fe21c Peter Zijlstra 2018-06-19 49 u32 uval;
e8708786d4fe21c Peter Zijlstra 2018-06-19 50 int ret;
91e040a79df73d3 Vineet Gupta 2016-10-20 51
91e040a79df73d3 Vineet Gupta 2016-10-20 52 /*
91e040a79df73d3 Vineet Gupta 2016-10-20 53 * This is only for old cores lacking LLOCK/SCOND, which by defintion
91e040a79df73d3 Vineet Gupta 2016-10-20 54 * can't possibly be SMP. Thus doesn't need to be SMP safe.
91e040a79df73d3 Vineet Gupta 2016-10-20 55 * And this also helps reduce the overhead for serializing in
91e040a79df73d3 Vineet Gupta 2016-10-20 56 * the UP case
91e040a79df73d3 Vineet Gupta 2016-10-20 57 */
91e040a79df73d3 Vineet Gupta 2016-10-20 58 WARN_ON_ONCE(IS_ENABLED(CONFIG_SMP));
91e040a79df73d3 Vineet Gupta 2016-10-20 59
e6e335bf3a400bc Vineet Gupta 2016-11-07 60 /* Z indicates to userspace if operation succeded */
e6e335bf3a400bc Vineet Gupta 2016-11-07 61 regs->status32 &= ~STATUS_Z_MASK;
e6e335bf3a400bc Vineet Gupta 2016-11-07 62
96d4f267e40f950 Linus Torvalds 2019-01-03 63 ret = access_ok(uaddr, sizeof(*uaddr));
e8708786d4fe21c Peter Zijlstra 2018-06-19 64 if (!ret)
e8708786d4fe21c Peter Zijlstra 2018-06-19 65 goto fail;
91e040a79df73d3 Vineet Gupta 2016-10-20 66
e8708786d4fe21c Peter Zijlstra 2018-06-19 67 again:
91e040a79df73d3 Vineet Gupta 2016-10-20 68 preempt_disable();
91e040a79df73d3 Vineet Gupta 2016-10-20 69
e8708786d4fe21c Peter Zijlstra 2018-06-19 @70 ret = __get_user(uval, uaddr);
e8708786d4fe21c Peter Zijlstra 2018-06-19 71 if (ret)
e8708786d4fe21c Peter Zijlstra 2018-06-19 72 goto fault;
e8708786d4fe21c Peter Zijlstra 2018-06-19 73
e8708786d4fe21c Peter Zijlstra 2018-06-19 74 if (uval != expected)
e8708786d4fe21c Peter Zijlstra 2018-06-19 75 goto out;
e8708786d4fe21c Peter Zijlstra 2018-06-19 76
e8708786d4fe21c Peter Zijlstra 2018-06-19 77 ret = __put_user(new, uaddr);
e8708786d4fe21c Peter Zijlstra 2018-06-19 78 if (ret)
e8708786d4fe21c Peter Zijlstra 2018-06-19 79 goto fault;
91e040a79df73d3 Vineet Gupta 2016-10-20 80
e6e335bf3a400bc Vineet Gupta 2016-11-07 81 regs->status32 |= STATUS_Z_MASK;
91e040a79df73d3 Vineet Gupta 2016-10-20 82
e8708786d4fe21c Peter Zijlstra 2018-06-19 83 out:
91e040a79df73d3 Vineet Gupta 2016-10-20 84 preempt_enable();
e6e335bf3a400bc Vineet Gupta 2016-11-07 85 return uval;
e8708786d4fe21c Peter Zijlstra 2018-06-19 86
e8708786d4fe21c Peter Zijlstra 2018-06-19 87 fault:
e8708786d4fe21c Peter Zijlstra 2018-06-19 88 preempt_enable();
e8708786d4fe21c Peter Zijlstra 2018-06-19 89
e8708786d4fe21c Peter Zijlstra 2018-06-19 90 if (unlikely(ret != -EFAULT))
e8708786d4fe21c Peter Zijlstra 2018-06-19 91 goto fail;
e8708786d4fe21c Peter Zijlstra 2018-06-19 92
d8ed45c5dcd455f Michel Lespinasse 2020-06-08 93 mmap_read_lock(current->mm);
64019a2e467a288 Peter Xu 2020-08-11 94 ret = fixup_user_fault(current->mm, (unsigned long) uaddr,
e8708786d4fe21c Peter Zijlstra 2018-06-19 95 FAULT_FLAG_WRITE, NULL);
d8ed45c5dcd455f Michel Lespinasse 2020-06-08 96 mmap_read_unlock(current->mm);
e8708786d4fe21c Peter Zijlstra 2018-06-19 97
e8708786d4fe21c Peter Zijlstra 2018-06-19 98 if (likely(!ret))
e8708786d4fe21c Peter Zijlstra 2018-06-19 99 goto again;
e8708786d4fe21c Peter Zijlstra 2018-06-19 100
e8708786d4fe21c Peter Zijlstra 2018-06-19 101 fail:
3cf5d076fb4d489 Eric W. Biederman 2019-05-23 102 force_sig(SIGSEGV);
e8708786d4fe21c Peter Zijlstra 2018-06-19 103 return ret;
91e040a79df73d3 Vineet Gupta 2016-10-20 104 }
91e040a79df73d3 Vineet Gupta 2016-10-20 105
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 30133 bytes --]
next prev parent reply other threads:[~2020-08-28 11:57 UTC|newest]
Thread overview: 32+ 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:15 ` [PATCH] sparse: use static inline for __chk_{user, io}_ptr() kernel test robot
2020-08-28 11:37 ` kernel test robot [this message]
2020-08-28 11:37 ` kernel test robot
2020-08-28 12:20 ` [PATCH] sparse: use static inline for __chk_{user,io}_ptr() kernel test robot
2020-08-28 12:20 ` [PATCH] sparse: use static inline for __chk_{user, io}_ptr() kernel test robot
2020-08-28 14:21 ` [PATCH] sparse: use static inline for __chk_{user,io}_ptr() kernel test robot
2020-08-28 14:21 ` [PATCH] sparse: use static inline for __chk_{user, io}_ptr() kernel test robot
2020-08-28 15:11 ` [PATCH] sparse: use static inline for __chk_{user,io}_ptr() kernel test robot
2020-08-28 15:11 ` [PATCH] sparse: use static inline for __chk_{user, io}_ptr() kernel test robot
2020-08-28 19:04 ` [PATCH] sparse: use static inline for __chk_{user,io}_ptr() Miguel Ojeda
2020-08-28 20:15 ` Luc Van Oostenryck
2020-08-29 7:33 ` Miguel Ojeda
2020-09-01 0:57 ` [PATCH] sparse: use static inline for __chk_{user, io}_ptr() kernel test robot
2020-09-01 5:33 ` kernel test robot
2020-09-01 21:37 ` kernel test robot
2020-09-02 1:12 ` kernel test robot
2020-09-03 2:56 ` kernel test robot
2020-09-03 4:06 ` kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2020-06-28 7:20 [PATCH] sparse: use static inline for __chk_{user,io}_ptr() Luc Van Oostenryck
2020-06-29 17:12 ` kernel test robot
2020-06-29 17:12 ` [PATCH] sparse: use static inline for __chk_{user, io}_ptr() kernel test robot
2020-06-29 18:08 ` [PATCH] sparse: use static inline for __chk_{user,io}_ptr() kernel test robot
2020-06-29 18:08 ` [PATCH] sparse: use static inline for __chk_{user, io}_ptr() kernel test robot
2020-06-29 18:37 ` [PATCH] sparse: use static inline for __chk_{user,io}_ptr() Luc Van Oostenryck
2020-06-29 18:37 ` [PATCH] sparse: use static inline for __chk_{user, io}_ptr() Luc Van Oostenryck
2020-06-30 0:31 ` Rong Chen
2020-06-30 11:58 ` [PATCH] sparse: use static inline for __chk_{user,io}_ptr() kernel test robot
2020-06-30 11:58 ` [PATCH] sparse: use static inline for __chk_{user, io}_ptr() kernel test robot
2020-07-01 18:35 ` [PATCH] sparse: use static inline for __chk_{user,io}_ptr() kernel test robot
2020-07-01 18:35 ` [PATCH] sparse: use static inline for __chk_{user, io}_ptr() 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=202008281918.2rxxINLK%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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.