lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202202210301.xEFgkf3s-lkp@intel.com>
Date:   Mon, 21 Feb 2022 03:18:00 +0800
From:   kernel test robot <lkp@...el.com>
To:     Aaron Tomlin <atomlin@...hat.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Luis Chamberlain <mcgrof@...nel.org>
Subject: [mcgrof:modules-next 6/10]
 arch/riscv/include/asm/set_memory.h:25:25: error: implicit declaration of
 function 'PAGE_ALIGN'; did you mean 'PTR_ALIGN'?

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git modules-next
head:   c55dc78176e6fe97a9e92d24a7ff3015b14ac858
commit: e5973a14d18785b893d383fbd9dc2f98edc16f1b [6/10] module: Move strict rwx support to a separate file
config: riscv-randconfig-r042-20220220 (https://download.01.org/0day-ci/archive/20220221/202202210301.xEFgkf3s-lkp@intel.com/config)
compiler: riscv32-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git/commit/?id=e5973a14d18785b893d383fbd9dc2f98edc16f1b
        git remote add mcgrof https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git
        git fetch --no-tags mcgrof modules-next
        git checkout e5973a14d18785b893d383fbd9dc2f98edc16f1b
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=riscv SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>

All errors (new ones prefixed by >>):

   In file included from include/linux/set_memory.h:9,
                    from kernel/module/strict_rwx.c:10:
   arch/riscv/include/asm/set_memory.h: In function 'set_kernel_memory':
>> arch/riscv/include/asm/set_memory.h:25:25: error: implicit declaration of function 'PAGE_ALIGN'; did you mean 'PTR_ALIGN'? [-Werror=implicit-function-declaration]
      25 |         int num_pages = PAGE_ALIGN(end - start) >> PAGE_SHIFT;
         |                         ^~~~~~~~~~
         |                         PTR_ALIGN
   In file included from include/linux/build_bug.h:5,
                    from include/linux/container_of.h:5,
                    from include/linux/list.h:5,
                    from include/linux/module.h:12,
                    from kernel/module/strict_rwx.c:8:
   kernel/module/strict_rwx.c: In function 'frob_rodata':
>> kernel/module/strict_rwx.c:16:17: error: implicit declaration of function 'PAGE_ALIGNED'; did you mean 'IS_ALIGNED'? [-Werror=implicit-function-declaration]
      16 |         BUG_ON(!PAGE_ALIGNED(layout->base));
         |                 ^~~~~~~~~~~~
   include/linux/compiler.h:78:45: note: in definition of macro 'unlikely'
      78 | # define unlikely(x)    __builtin_expect(!!(x), 0)
         |                                             ^
   kernel/module/strict_rwx.c:16:9: note: in expansion of macro 'BUG_ON'
      16 |         BUG_ON(!PAGE_ALIGNED(layout->base));
         |         ^~~~~~
   cc1: some warnings being treated as errors


vim +25 arch/riscv/include/asm/set_memory.h

d3ab332a502123 Zong Li         2020-03-10   8  
00cb41d5ad3189 Zong Li         2020-03-10   9  #ifndef __ASSEMBLY__
d3ab332a502123 Zong Li         2020-03-10  10  /*
d3ab332a502123 Zong Li         2020-03-10  11   * Functions to change memory attributes.
d3ab332a502123 Zong Li         2020-03-10  12   */
d3ab332a502123 Zong Li         2020-03-10  13  #ifdef CONFIG_MMU
d3ab332a502123 Zong Li         2020-03-10  14  int set_memory_ro(unsigned long addr, int numpages);
d3ab332a502123 Zong Li         2020-03-10  15  int set_memory_rw(unsigned long addr, int numpages);
d3ab332a502123 Zong Li         2020-03-10  16  int set_memory_x(unsigned long addr, int numpages);
d3ab332a502123 Zong Li         2020-03-10  17  int set_memory_nx(unsigned long addr, int numpages);
19a00869028f4a Atish Patra     2020-11-04  18  int set_memory_rw_nx(unsigned long addr, int numpages);
c10bc260e7c030 Alexandre Ghiti 2021-06-24  19  static __always_inline int set_kernel_memory(char *startp, char *endp,
c10bc260e7c030 Alexandre Ghiti 2021-06-24  20  					     int (*set_memory)(unsigned long start,
c10bc260e7c030 Alexandre Ghiti 2021-06-24  21  							       int num_pages))
c10bc260e7c030 Alexandre Ghiti 2021-06-24  22  {
c10bc260e7c030 Alexandre Ghiti 2021-06-24  23  	unsigned long start = (unsigned long)startp;
c10bc260e7c030 Alexandre Ghiti 2021-06-24  24  	unsigned long end = (unsigned long)endp;
c10bc260e7c030 Alexandre Ghiti 2021-06-24 @25  	int num_pages = PAGE_ALIGN(end - start) >> PAGE_SHIFT;
c10bc260e7c030 Alexandre Ghiti 2021-06-24  26  
c10bc260e7c030 Alexandre Ghiti 2021-06-24  27  	return set_memory(start, num_pages);
c10bc260e7c030 Alexandre Ghiti 2021-06-24  28  }
d3ab332a502123 Zong Li         2020-03-10  29  #else
d3ab332a502123 Zong Li         2020-03-10  30  static inline int set_memory_ro(unsigned long addr, int numpages) { return 0; }
d3ab332a502123 Zong Li         2020-03-10  31  static inline int set_memory_rw(unsigned long addr, int numpages) { return 0; }
d3ab332a502123 Zong Li         2020-03-10  32  static inline int set_memory_x(unsigned long addr, int numpages) { return 0; }
d3ab332a502123 Zong Li         2020-03-10  33  static inline int set_memory_nx(unsigned long addr, int numpages) { return 0; }
19a00869028f4a Atish Patra     2020-11-04  34  static inline int set_memory_rw_nx(unsigned long addr, int numpages) { return 0; }
c10bc260e7c030 Alexandre Ghiti 2021-06-24  35  static inline int set_kernel_memory(char *startp, char *endp,
c10bc260e7c030 Alexandre Ghiti 2021-06-24  36  				    int (*set_memory)(unsigned long start,
c10bc260e7c030 Alexandre Ghiti 2021-06-24  37  						      int num_pages))
c10bc260e7c030 Alexandre Ghiti 2021-06-24  38  {
c10bc260e7c030 Alexandre Ghiti 2021-06-24  39  	return 0;
c10bc260e7c030 Alexandre Ghiti 2021-06-24  40  }
d3ab332a502123 Zong Li         2020-03-10  41  #endif
d3ab332a502123 Zong Li         2020-03-10  42  

:::::: The code at line 25 was first introduced by commit
:::::: c10bc260e7c030364b5150aac7ebf048ddfb9502 riscv: Introduce set_kernel_memory helper

:::::: TO: Alexandre Ghiti <alex@...ti.fr>
:::::: CC: Palmer Dabbelt <palmerdabbelt@...gle.com>

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ