From: kbuild test robot <lkp@intel.com>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>,
linuxppc-dev@lists.ozlabs.org, mpe@ellerman.id.au
Cc: kbuild-all@lists.01.org
Subject: Re: [PATCH 1/3] powerpc/va: Add a __va() variant that doesn't do input validation
Date: Fri, 8 May 2020 09:52:05 +0800 [thread overview]
Message-ID: <202005080908.ju72vKrU%lkp@intel.com> (raw)
In-Reply-To: <20200507142316.265457-1-aneesh.kumar@linux.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 6677 bytes --]
Hi "Aneesh,
I love your patch! Perhaps something to improve:
[auto build test WARNING on powerpc/next]
[also build test WARNING on v5.7-rc4 next-20200507]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Aneesh-Kumar-K-V/powerpc-va-Add-a-__va-variant-that-doesn-t-do-input-validation/20200508-042829
base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-linux-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
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
arch/powerpc/platforms/powernv/opal-core.c: In function 'read_opalcore':
>> arch/powerpc/platforms/powernv/opal-core.c:199:20: warning: passing argument 1 of '__va' makes integer from pointer without a cast [-Wint-conversion]
199 | memcpy(to, __va(addr), tsz);
| ^~~~
| |
| void *
In file included from arch/powerpc/include/asm/mmu.h:132,
from arch/powerpc/include/asm/lppaca.h:47,
from arch/powerpc/include/asm/paca.h:17,
from arch/powerpc/include/asm/current.h:13,
from include/linux/thread_info.h:21,
from include/asm-generic/preempt.h:5,
from ./arch/powerpc/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:51,
from include/linux/mmzone.h:8,
from include/linux/gfp.h:6,
from include/linux/mm.h:10,
from include/linux/memblock.h:13,
from arch/powerpc/platforms/powernv/opal-core.c:11:
arch/powerpc/include/asm/page.h:229:38: note: expected 'phys_addr_t' {aka 'long long unsigned int'} but argument is of type 'void *'
229 | static inline void *__va(phys_addr_t addr)
| ~~~~~~~~~~~~^~~~
vim +/__va +199 arch/powerpc/platforms/powernv/opal-core.c
6f713d18144ce86 Hari Bathini 2019-09-11 156
6f713d18144ce86 Hari Bathini 2019-09-11 157 /*
6f713d18144ce86 Hari Bathini 2019-09-11 158 * Read from the ELF header and then the crash dump.
6f713d18144ce86 Hari Bathini 2019-09-11 159 * Returns number of bytes read on success, -errno on failure.
6f713d18144ce86 Hari Bathini 2019-09-11 160 */
6f713d18144ce86 Hari Bathini 2019-09-11 161 static ssize_t read_opalcore(struct file *file, struct kobject *kobj,
6f713d18144ce86 Hari Bathini 2019-09-11 162 struct bin_attribute *bin_attr, char *to,
6f713d18144ce86 Hari Bathini 2019-09-11 163 loff_t pos, size_t count)
6f713d18144ce86 Hari Bathini 2019-09-11 164 {
6f713d18144ce86 Hari Bathini 2019-09-11 165 struct opalcore *m;
6f713d18144ce86 Hari Bathini 2019-09-11 166 ssize_t tsz, avail;
6f713d18144ce86 Hari Bathini 2019-09-11 167 loff_t tpos = pos;
6f713d18144ce86 Hari Bathini 2019-09-11 168
6f713d18144ce86 Hari Bathini 2019-09-11 169 if (pos >= oc_conf->opalcore_size)
6f713d18144ce86 Hari Bathini 2019-09-11 170 return 0;
6f713d18144ce86 Hari Bathini 2019-09-11 171
6f713d18144ce86 Hari Bathini 2019-09-11 172 /* Adjust count if it goes beyond opalcore size */
6f713d18144ce86 Hari Bathini 2019-09-11 173 avail = oc_conf->opalcore_size - pos;
6f713d18144ce86 Hari Bathini 2019-09-11 174 if (count > avail)
6f713d18144ce86 Hari Bathini 2019-09-11 175 count = avail;
6f713d18144ce86 Hari Bathini 2019-09-11 176
6f713d18144ce86 Hari Bathini 2019-09-11 177 if (count == 0)
6f713d18144ce86 Hari Bathini 2019-09-11 178 return 0;
6f713d18144ce86 Hari Bathini 2019-09-11 179
6f713d18144ce86 Hari Bathini 2019-09-11 180 /* Read ELF core header and/or PT_NOTE segment */
6f713d18144ce86 Hari Bathini 2019-09-11 181 if (tpos < oc_conf->opalcorebuf_sz) {
6f713d18144ce86 Hari Bathini 2019-09-11 182 tsz = min_t(size_t, oc_conf->opalcorebuf_sz - tpos, count);
6f713d18144ce86 Hari Bathini 2019-09-11 183 memcpy(to, oc_conf->opalcorebuf + tpos, tsz);
6f713d18144ce86 Hari Bathini 2019-09-11 184 to += tsz;
6f713d18144ce86 Hari Bathini 2019-09-11 185 tpos += tsz;
6f713d18144ce86 Hari Bathini 2019-09-11 186 count -= tsz;
6f713d18144ce86 Hari Bathini 2019-09-11 187 }
6f713d18144ce86 Hari Bathini 2019-09-11 188
6f713d18144ce86 Hari Bathini 2019-09-11 189 list_for_each_entry(m, &opalcore_list, list) {
6f713d18144ce86 Hari Bathini 2019-09-11 190 /* nothing more to read here */
6f713d18144ce86 Hari Bathini 2019-09-11 191 if (count == 0)
6f713d18144ce86 Hari Bathini 2019-09-11 192 break;
6f713d18144ce86 Hari Bathini 2019-09-11 193
6f713d18144ce86 Hari Bathini 2019-09-11 194 if (tpos < m->offset + m->size) {
6f713d18144ce86 Hari Bathini 2019-09-11 195 void *addr;
6f713d18144ce86 Hari Bathini 2019-09-11 196
6f713d18144ce86 Hari Bathini 2019-09-11 197 tsz = min_t(size_t, m->offset + m->size - tpos, count);
6f713d18144ce86 Hari Bathini 2019-09-11 198 addr = (void *)(m->paddr + tpos - m->offset);
6f713d18144ce86 Hari Bathini 2019-09-11 @199 memcpy(to, __va(addr), tsz);
6f713d18144ce86 Hari Bathini 2019-09-11 200 to += tsz;
6f713d18144ce86 Hari Bathini 2019-09-11 201 tpos += tsz;
6f713d18144ce86 Hari Bathini 2019-09-11 202 count -= tsz;
6f713d18144ce86 Hari Bathini 2019-09-11 203 }
6f713d18144ce86 Hari Bathini 2019-09-11 204 }
6f713d18144ce86 Hari Bathini 2019-09-11 205
6f713d18144ce86 Hari Bathini 2019-09-11 206 return (tpos - pos);
6f713d18144ce86 Hari Bathini 2019-09-11 207 }
6f713d18144ce86 Hari Bathini 2019-09-11 208
:::::: The code at line 199 was first introduced by commit
:::::: 6f713d18144ce86c9f01cdf64222d6339e26129e powerpc/opalcore: export /sys/firmware/opal/core for analysing opal crashes
:::::: TO: Hari Bathini <hbathini@linux.vnet.ibm.com>
:::::: CC: Michael Ellerman <mpe@ellerman.id.au>
---
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: 66039 bytes --]
prev parent reply other threads:[~2020-05-08 1:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-07 14:23 [PATCH 1/3] powerpc/va: Add a __va() variant that doesn't do input validation Aneesh Kumar K.V
2020-05-07 14:23 ` [PATCH 2/3] powerpc: Fix instruction dumping to use address value correctly Aneesh Kumar K.V
2020-05-07 14:23 ` [PATCH 3/3] powerp: Avoid opencoding fixup_real_addr Aneesh Kumar K.V
2020-05-08 1:52 ` kbuild test robot [this message]
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=202005080908.ju72vKrU%lkp@intel.com \
--to=lkp@intel.com \
--cc=aneesh.kumar@linux.ibm.com \
--cc=kbuild-all@lists.01.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
/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).