[cris:acpi_pcc_v3_telemetry_ng_V10_on_v7.1 30/35] include/linux/fortify-string.h:746:17: error: call to '__read_overflow' declared with attribute error: detected read beyond size of object (1st parameter)

kernel test robot <[email protected]>
Newsgroups dev.linux.lists.oe-kbuild-all
Message-ID <[email protected]>
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/cris/linux.git acpi_pcc_v3_telemetry_ng_V10_on_v7.1
head:   330fae3bb5f8a8b084685e5944f0c7bbb5717d2e
commit: e67a787d5fc392d162d321d38430ce6af039e0fe [30/35] firmware: arm_scmi: Add System Telemetry driver
config: powerpc-allmodconfig (https://download.01.org/0day-ci/archive/20260819/[email protected]/config)
compiler: powerpc64-linux-gcc (GCC) 16.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260819/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

   In file included from include/linux/string.h:386,
                    from arch/powerpc/include/asm/paca.h:16,
                    from arch/powerpc/include/asm/current.h:13,
                    from include/linux/mutex.h:14,
                    from include/linux/kernfs.h:11,
                    from include/linux/sysfs.h:16,
                    from include/linux/kobject.h:20,
                    from include/linux/cdev.h:5,
                    from drivers/firmware/arm_scmi/scmi_system_telemetry.c:11:
   In function 'memchr_inv',
       inlined from 'copy_struct_to_user' at include/linux/uaccess.h:514:4,
       inlined from 'scmi_tlm_abi_info_get_ioctl' at drivers/firmware/arm_scmi/scmi_system_telemetry.c:264:8:
>> include/linux/fortify-string.h:746:17: error: call to '__read_overflow' declared with attribute error: detected read beyond size of object (1st parameter)
     746 |                 __read_overflow();
         |                 ^~~~~~~~~~~~~~~~~


vim +/__read_overflow +746 include/linux/fortify-string.h

a28a6e860c6cf23 Francis Laniel 2021-02-25  739  
a28a6e860c6cf23 Francis Laniel 2021-02-25  740  void *__real_memchr_inv(const void *s, int c, size_t n) __RENAME(memchr_inv);
281d0c962752fb4 Kees Cook      2022-02-08  741  __FORTIFY_INLINE void *memchr_inv(const void * const POS0 p, int c, size_t size)
a28a6e860c6cf23 Francis Laniel 2021-02-25  742  {
21a2c74b0a2a784 Kees Cook      2023-04-07  743  	const size_t p_size = __struct_size(p);
a28a6e860c6cf23 Francis Laniel 2021-02-25  744  
fa35198f39571bb Kees Cook      2022-09-19  745  	if (__compiletime_lessthan(p_size, size))
a28a6e860c6cf23 Francis Laniel 2021-02-25 @746  		__read_overflow();
a28a6e860c6cf23 Francis Laniel 2021-02-25  747  	if (p_size < size)
3d965b33e40d973 Kees Cook      2023-04-07  748  		fortify_panic(FORTIFY_FUNC_memchr_inv, FORTIFY_READ, p_size, size, NULL);
a28a6e860c6cf23 Francis Laniel 2021-02-25  749  	return __real_memchr_inv(p, c, size);
a28a6e860c6cf23 Francis Laniel 2021-02-25  750  }
a28a6e860c6cf23 Francis Laniel 2021-02-25  751  

:::::: The code at line 746 was first introduced by commit
:::::: a28a6e860c6cf231cf3c5171c75c342adcd00406 string.h: move fortified functions definitions in a dedicated header.

:::::: TO: Francis Laniel <[email protected]>
:::::: CC: Linus Torvalds <[email protected]>

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.