From: kernel test robot <lkp@intel.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [arm-integrator:b4/virt-to-phys-kfence 2/2] include/linux/kfence.h:58:47: error: 'char *' and 'void *' are not pointers to compatible types
Date: Thu, 10 Aug 2023 17:48:48 +0800 [thread overview]
Message-ID: <202308101758.4SiUa8Ee-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator.git b4/virt-to-phys-kfence
head: 709c5a98b878015dc4f8838fca1c0194b42dee86
commit: 709c5a98b878015dc4f8838fca1c0194b42dee86 [2/2] kfence: Use a void * for page pool
config: riscv-randconfig-r042-20230809 (https://download.01.org/0day-ci/archive/20230810/202308101758.4SiUa8Ee-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce: (https://download.01.org/0day-ci/archive/20230810/202308101758.4SiUa8Ee-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202308101758.4SiUa8Ee-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from mm/slub.c:21:
In file included from mm/slab.h:236:
In file included from include/linux/slub_def.h:10:
>> include/linux/kfence.h:58:47: error: 'char *' and 'void *' are not pointers to compatible types
return unlikely((unsigned long)((char *)addr - __kfence_pool) < KFENCE_POOL_SIZE && __kfence_pool);
~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~
include/linux/compiler.h:77:42: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^
1 error generated.
vim +58 include/linux/kfence.h
0ce20dd840897b Alexander Potapenko 2021-02-25 32
0ce20dd840897b Alexander Potapenko 2021-02-25 33 /**
0ce20dd840897b Alexander Potapenko 2021-02-25 34 * is_kfence_address() - check if an address belongs to KFENCE pool
0ce20dd840897b Alexander Potapenko 2021-02-25 35 * @addr: address to check
0ce20dd840897b Alexander Potapenko 2021-02-25 36 *
0ce20dd840897b Alexander Potapenko 2021-02-25 37 * Return: true or false depending on whether the address is within the KFENCE
0ce20dd840897b Alexander Potapenko 2021-02-25 38 * object range.
0ce20dd840897b Alexander Potapenko 2021-02-25 39 *
0ce20dd840897b Alexander Potapenko 2021-02-25 40 * KFENCE objects live in a separate page range and are not to be intermixed
0ce20dd840897b Alexander Potapenko 2021-02-25 41 * with regular heap objects (e.g. KFENCE objects must never be added to the
0ce20dd840897b Alexander Potapenko 2021-02-25 42 * allocator freelists). Failing to do so may and will result in heap
0ce20dd840897b Alexander Potapenko 2021-02-25 43 * corruptions, therefore is_kfence_address() must be used to check whether
0ce20dd840897b Alexander Potapenko 2021-02-25 44 * an object requires specific handling.
0ce20dd840897b Alexander Potapenko 2021-02-25 45 *
0ce20dd840897b Alexander Potapenko 2021-02-25 46 * Note: This function may be used in fast-paths, and is performance critical.
0ce20dd840897b Alexander Potapenko 2021-02-25 47 * Future changes should take this into account; for instance, we want to avoid
0ce20dd840897b Alexander Potapenko 2021-02-25 48 * introducing another load and therefore need to keep KFENCE_POOL_SIZE a
0ce20dd840897b Alexander Potapenko 2021-02-25 49 * constant (until immediate patching support is added to the kernel).
0ce20dd840897b Alexander Potapenko 2021-02-25 50 */
0ce20dd840897b Alexander Potapenko 2021-02-25 51 static __always_inline bool is_kfence_address(const void *addr)
0ce20dd840897b Alexander Potapenko 2021-02-25 52 {
0ce20dd840897b Alexander Potapenko 2021-02-25 53 /*
a7cb5d23eaea14 Marco Elver 2021-08-19 54 * The __kfence_pool != NULL check is required to deal with the case
a7cb5d23eaea14 Marco Elver 2021-08-19 55 * where __kfence_pool == NULL && addr < KFENCE_POOL_SIZE. Keep it in
a7cb5d23eaea14 Marco Elver 2021-08-19 56 * the slow-path after the range-check!
0ce20dd840897b Alexander Potapenko 2021-02-25 57 */
a7cb5d23eaea14 Marco Elver 2021-08-19 @58 return unlikely((unsigned long)((char *)addr - __kfence_pool) < KFENCE_POOL_SIZE && __kfence_pool);
0ce20dd840897b Alexander Potapenko 2021-02-25 59 }
0ce20dd840897b Alexander Potapenko 2021-02-25 60
:::::: The code at line 58 was first introduced by commit
:::::: a7cb5d23eaea148f8582229846f8dfff192f05c3 kfence: fix is_kfence_address() for addresses below KFENCE_POOL_SIZE
:::::: TO: Marco Elver <elver@google.com>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2023-08-10 9:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-10 9:48 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-08-10 10:20 [arm-integrator:b4/virt-to-phys-kfence 2/2] include/linux/kfence.h:58:47: error: 'char *' and 'void *' are not pointers to compatible types kernel test robot
2023-09-13 16:25 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=202308101758.4SiUa8Ee-lkp@intel.com \
--to=lkp@intel.com \
--cc=linus.walleij@linaro.org \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
/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