tree: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-unstable head: 988a57a6576e4e7f4ad22aa1486fcd807b83f38b commit: b58bcd8602ac75d2c1e2757d4027ae039fed6f4c [14/80] mm: kfence: fix false positives on big endian config: parisc-randconfig-s043-20230507 (https://download.01.org/0day-ci/archive/20230507/202305070938.YhOGAf6p-lkp@xxxxxxxxx/config) compiler: hppa-linux-gcc (GCC) 12.1.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-39-gce1a6720-dirty # https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git/commit/?id=b58bcd8602ac75d2c1e2757d4027ae039fed6f4c git remote add akpm-mm https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git git fetch --no-tags akpm-mm mm-unstable git checkout b58bcd8602ac75d2c1e2757d4027ae039fed6f4c # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=parisc olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=parisc SHELL=/bin/bash mm/kfence/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@xxxxxxxxx> | Link: https://lore.kernel.org/oe-kbuild-all/202305070938.YhOGAf6p-lkp@xxxxxxxxx/ sparse warnings: (new ones prefixed by >>) >> mm/kfence/core.c:329:34: sparse: sparse: cast to restricted __le64 >> mm/kfence/core.c:329:34: sparse: sparse: cast to restricted __le64 >> mm/kfence/core.c:329:34: sparse: sparse: cast to restricted __le64 >> mm/kfence/core.c:329:34: sparse: sparse: cast to restricted __le64 >> mm/kfence/core.c:329:34: sparse: sparse: cast to restricted __le64 >> mm/kfence/core.c:329:34: sparse: sparse: cast to restricted __le64 >> mm/kfence/core.c:329:34: sparse: sparse: cast to restricted __le64 >> mm/kfence/core.c:329:34: sparse: sparse: cast to restricted __le64 >> mm/kfence/core.c:329:34: sparse: sparse: cast to restricted __le64 >> mm/kfence/core.c:329:34: sparse: sparse: cast to restricted __le64 mm/kfence/core.c:333:34: sparse: sparse: cast to restricted __le64 mm/kfence/core.c:333:34: sparse: sparse: cast to restricted __le64 mm/kfence/core.c:333:34: sparse: sparse: cast to restricted __le64 mm/kfence/core.c:333:34: sparse: sparse: cast to restricted __le64 mm/kfence/core.c:333:34: sparse: sparse: cast to restricted __le64 mm/kfence/core.c:333:34: sparse: sparse: cast to restricted __le64 mm/kfence/core.c:333:34: sparse: sparse: cast to restricted __le64 mm/kfence/core.c:333:34: sparse: sparse: cast to restricted __le64 mm/kfence/core.c:333:34: sparse: sparse: cast to restricted __le64 mm/kfence/core.c:333:34: sparse: sparse: cast to restricted __le64 mm/kfence/core.c:352:21: sparse: sparse: cast to restricted __le64 mm/kfence/core.c:352:21: sparse: sparse: cast to restricted __le64 mm/kfence/core.c:352:21: sparse: sparse: cast to restricted __le64 mm/kfence/core.c:352:21: sparse: sparse: cast to restricted __le64 mm/kfence/core.c:352:21: sparse: sparse: cast to restricted __le64 mm/kfence/core.c:352:21: sparse: sparse: cast to restricted __le64 mm/kfence/core.c:352:21: sparse: sparse: cast to restricted __le64 mm/kfence/core.c:352:21: sparse: sparse: cast to restricted __le64 mm/kfence/core.c:352:21: sparse: sparse: cast to restricted __le64 mm/kfence/core.c:352:21: sparse: sparse: cast to restricted __le64 mm/kfence/core.c:372:21: sparse: sparse: cast to restricted __le64 mm/kfence/core.c:372:21: sparse: sparse: cast to restricted __le64 mm/kfence/core.c:372:21: sparse: sparse: cast to restricted __le64 mm/kfence/core.c:372:21: sparse: sparse: cast to restricted __le64 mm/kfence/core.c:372:21: sparse: sparse: cast to restricted __le64 mm/kfence/core.c:372:21: sparse: sparse: cast to restricted __le64 mm/kfence/core.c:372:21: sparse: sparse: cast to restricted __le64 mm/kfence/core.c:372:21: sparse: sparse: cast to restricted __le64 mm/kfence/core.c:372:21: sparse: sparse: cast to restricted __le64 mm/kfence/core.c:372:21: sparse: sparse: cast to restricted __le64 mm/kfence/core.c:1181:9: sparse: sparse: context imbalance in 'kfence_handle_page_fault' - different lock contexts for basic block vim +329 mm/kfence/core.c 0ce20dd840897b Alexander Potapenko 2021-02-25 318 1ba3cbf3ec3b21 Peng Zhang 2023-04-03 319 static inline void set_canary(const struct kfence_metadata *meta) 0ce20dd840897b Alexander Potapenko 2021-02-25 320 { 0ce20dd840897b Alexander Potapenko 2021-02-25 321 const unsigned long pageaddr = ALIGN_DOWN(meta->addr, PAGE_SIZE); 1ba3cbf3ec3b21 Peng Zhang 2023-04-03 322 unsigned long addr = pageaddr; 1ba3cbf3ec3b21 Peng Zhang 2023-04-03 323 1ba3cbf3ec3b21 Peng Zhang 2023-04-03 324 /* 1ba3cbf3ec3b21 Peng Zhang 2023-04-03 325 * The canary may be written to part of the object memory, but it does 1ba3cbf3ec3b21 Peng Zhang 2023-04-03 326 * not affect it. The user should initialize the object before using it. 1ba3cbf3ec3b21 Peng Zhang 2023-04-03 327 */ 1ba3cbf3ec3b21 Peng Zhang 2023-04-03 328 for (; addr < meta->addr; addr += sizeof(u64)) 1ba3cbf3ec3b21 Peng Zhang 2023-04-03 @329 *((u64 *)addr) = KFENCE_CANARY_PATTERN_U64; 1ba3cbf3ec3b21 Peng Zhang 2023-04-03 330 1ba3cbf3ec3b21 Peng Zhang 2023-04-03 331 addr = ALIGN_DOWN(meta->addr + meta->size, sizeof(u64)); 1ba3cbf3ec3b21 Peng Zhang 2023-04-03 332 for (; addr - pageaddr < PAGE_SIZE; addr += sizeof(u64)) 1ba3cbf3ec3b21 Peng Zhang 2023-04-03 333 *((u64 *)addr) = KFENCE_CANARY_PATTERN_U64; 1ba3cbf3ec3b21 Peng Zhang 2023-04-03 334 } 1ba3cbf3ec3b21 Peng Zhang 2023-04-03 335 :::::: The code at line 329 was first introduced by commit :::::: 1ba3cbf3ec3b21d866436fb46b4bb7bdc38608f9 mm: kfence: improve the performance of __kfence_alloc() and __kfence_free() :::::: TO: Peng Zhang <zhangpeng.00@xxxxxxxxxxxxx> :::::: CC: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests