All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [RFC PATCH v3 09/13] module: Move kallsyms support into a separate file
Date: Sat, 29 Jan 2022 14:52:39 +0800	[thread overview]
Message-ID: <202201291433.XLcEC5fB-lkp@intel.com> (raw)
In-Reply-To: <20220128203934.600247-10-atomlin@redhat.com>

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

Hi Aaron,

[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on a97ac8cb24a3c3ad74794adb83717ef1605d1b47]

url:    https://github.com/0day-ci/linux/commits/Aaron-Tomlin/module-core-code-clean-up/20220129-044218
base:   a97ac8cb24a3c3ad74794adb83717ef1605d1b47
config: arc-randconfig-s032-20220124 (https://download.01.org/0day-ci/archive/20220129/202201291433.XLcEC5fB-lkp(a)intel.com/config)
compiler: arceb-elf-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.4-dirty
        # https://github.com/0day-ci/linux/commit/fd6ae2d3fa439baa614e32c58b4c2f0dd0faa186
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Aaron-Tomlin/module-core-code-clean-up/20220129-044218
        git checkout fd6ae2d3fa439baa614e32c58b4c2f0dd0faa186
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arc SHELL=/bin/bash

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 >>)
   kernel/module/kallsyms.c: note: in included file:
   include/linux/module.h:386:3: sparse: sparse: symbol 'mod_tree' was not declared. Should it be static?
>> kernel/module/kallsyms.c:174:23: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct mod_kallsyms [noderef] __rcu *kallsyms @@     got void * @@
   kernel/module/kallsyms.c:174:23: sparse:     expected struct mod_kallsyms [noderef] __rcu *kallsyms
   kernel/module/kallsyms.c:174:23: sparse:     got void *
>> kernel/module/kallsyms.c:176:12: sparse: sparse: dereference of noderef expression
   kernel/module/kallsyms.c:177:12: sparse: sparse: dereference of noderef expression
   kernel/module/kallsyms.c:179:12: sparse: sparse: dereference of noderef expression
   kernel/module/kallsyms.c:180:12: sparse: sparse: dereference of noderef expression
   kernel/module/kallsyms.c:189:18: sparse: sparse: dereference of noderef expression
   kernel/module/kallsyms.c:190:35: sparse: sparse: dereference of noderef expression
   kernel/module/kallsyms.c:191:20: sparse: sparse: dereference of noderef expression
   kernel/module/kallsyms.c:196:32: sparse: sparse: dereference of noderef expression
   kernel/module/kallsyms.c:199:45: sparse: sparse: dereference of noderef expression

vim +174 kernel/module/kallsyms.c

   159	
   160	/*
   161	 * We use the full symtab and strtab which layout_symtab arranged to
   162	 * be appended to the init section.  Later we switch to the cut-down
   163	 * core-only ones.
   164	 */
   165	void add_kallsyms(struct module *mod, const struct load_info *info)
   166	{
   167		unsigned int i, ndst;
   168		const Elf_Sym *src;
   169		Elf_Sym *dst;
   170		char *s;
   171		Elf_Shdr *symsec = &info->sechdrs[info->index.sym];
   172	
   173		/* Set up to point into init section. */
 > 174		mod->kallsyms = mod->init_layout.base + info->mod_kallsyms_init_off;
   175	
 > 176		mod->kallsyms->symtab = (void *)symsec->sh_addr;
   177		mod->kallsyms->num_symtab = symsec->sh_size / sizeof(Elf_Sym);
   178		/* Make sure we get permanent strtab: don't use info->strtab. */
   179		mod->kallsyms->strtab = (void *)info->sechdrs[info->index.str].sh_addr;
   180		mod->kallsyms->typetab = mod->init_layout.base + info->init_typeoffs;
   181	
   182		/*
   183		 * Now populate the cut down core kallsyms for after init
   184		 * and set types up while we still have access to sections.
   185		 */
   186		mod->core_kallsyms.symtab = dst = mod->core_layout.base + info->symoffs;
   187		mod->core_kallsyms.strtab = s = mod->core_layout.base + info->stroffs;
   188		mod->core_kallsyms.typetab = mod->core_layout.base + info->core_typeoffs;
   189		src = mod->kallsyms->symtab;
   190		for (ndst = i = 0; i < mod->kallsyms->num_symtab; i++) {
   191			mod->kallsyms->typetab[i] = elf_type(src + i, info);
   192			if (i == 0 || is_livepatch_module(mod) ||
   193			    is_core_symbol(src+i, info->sechdrs, info->hdr->e_shnum,
   194					   info->index.pcpu)) {
   195				mod->core_kallsyms.typetab[ndst] =
   196				    mod->kallsyms->typetab[i];
   197				dst[ndst] = src[i];
   198				dst[ndst++].st_name = s - mod->core_kallsyms.strtab;
   199				s += strscpy(s, &mod->kallsyms->strtab[src[i].st_name],
   200					     KSYM_NAME_LEN) + 1;
   201			}
   202		}
   203		mod->core_kallsyms.num_symtab = ndst;
   204	}
   205	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

  parent reply	other threads:[~2022-01-29  6:52 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-28 20:39 [RFC PATCH v3 00/13] module: core code clean up Aaron Tomlin
2022-01-28 20:39 ` [RFC PATCH v3 01/13] module: Move all into module/ Aaron Tomlin
2022-01-28 20:39 ` [RFC PATCH v3 02/13] module: Simple refactor in preparation for split Aaron Tomlin
2022-01-28 20:39 ` [RFC PATCH v3 03/13] module: Move livepatch support to a separate file Aaron Tomlin
2022-01-29  7:27   ` Joe Perches
2022-01-28 20:39 ` [RFC PATCH v3 04/13] module: Move latched RB-tree " Aaron Tomlin
2022-01-28 21:55   ` kernel test robot
2022-01-28 20:39 ` [RFC PATCH v3 05/13] module: Move arch strict rwx " Aaron Tomlin
2022-01-28 20:39 ` [RFC PATCH v3 06/13] module: Move " Aaron Tomlin
2022-01-28 20:39 ` [RFC PATCH v3 07/13] module: Move extra signature support out of core code Aaron Tomlin
2022-01-28 20:39 ` [RFC PATCH v3 08/13] module: Move kmemleak support to a separate file Aaron Tomlin
2022-01-28 20:39 ` [RFC PATCH v3 09/13] module: Move kallsyms support into " Aaron Tomlin
2022-01-28 22:56   ` kernel test robot
2022-01-29  6:52   ` kernel test robot [this message]
2022-01-28 20:39 ` [RFC PATCH v3 10/13] module: Move procfs " Aaron Tomlin
2022-01-28 20:39 ` [RFC PATCH v3 11/13] module: Move sysfs " Aaron Tomlin
2022-01-28 20:39 ` [RFC PATCH v3 12/13] module: Move kdb_modules list out of core code Aaron Tomlin
2022-01-28 20:39 ` [RFC PATCH v3 13/13] module: Move version support into a separate file Aaron Tomlin
2022-01-28 22:36   ` kernel test robot
2022-01-28 22:22 ` [RFC PATCH v3 00/13] module: core code clean up Oleksandr Natalenko
  -- strict thread matches above, loose matches on Subject: below --
2022-01-28 20:26 Aaron Tomlin
2022-01-28 20:26 ` [RFC PATCH v3 09/13] module: Move kallsyms support into a separate file Aaron Tomlin
2022-01-28 13:23 [RFC PATCH v3 00/13] module: core code clean up Aaron Tomlin
2022-01-28 13:23 ` [RFC PATCH v3 09/13] module: Move kallsyms support into a separate file Aaron Tomlin
2022-01-28 12:50 [RFC PATCH v3 00/13] module: core code clean up Aaron Tomlin
2022-01-28 12:50 ` [RFC PATCH v3 09/13] module: Move kallsyms support into a separate file Aaron Tomlin

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=202201291433.XLcEC5fB-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /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.