All of lore.kernel.org
 help / color / mirror / Atom feed
* include/linux/fortify-string.h:27:30: warning: '__builtin_strncpy' output truncated copying between 0 and 32 bytes from a string of length 32
@ 2021-03-03  2:09 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-03-03  2:09 UTC (permalink / raw)
  To: Francis Laniel
  Cc: kbuild-all, linux-kernel, Andrew Morton, Linux Memory Management List

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7a7fd0de4a9804299793e564a555a49c1fc924cb
commit: a28a6e860c6cf231cf3c5171c75c342adcd00406 string.h: move fortified functions definitions in a dedicated header.
date:   4 days ago
config: mips-randconfig-r016-20210302 (attached as .config)
compiler: mipsel-linux-gcc (GCC) 9.3.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/torvalds/linux.git/commit/?id=a28a6e860c6cf231cf3c5171c75c342adcd00406
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout a28a6e860c6cf231cf3c5171c75c342adcd00406
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips 

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

All warnings (new ones prefixed by >>):

   In file included from include/linux/string.h:269,
                    from include/linux/bitmap.h:9,
                    from include/linux/cpumask.h:12,
                    from include/linux/smp.h:13,
                    from arch/mips/include/asm/cpu-type.h:12,
                    from arch/mips/include/asm/timex.h:19,
                    from include/linux/timex.h:65,
                    from include/linux/time32.h:13,
                    from include/linux/time.h:60,
                    from include/linux/stat.h:19,
                    from include/linux/module.h:13,
                    from lib/test_hexdump.c:8:
   In function 'strncpy',
       inlined from 'test_hexdump_prepare_test.isra.0' at lib/test_hexdump.c:116:3:
>> include/linux/fortify-string.h:27:30: warning: '__builtin_strncpy' output truncated copying between 0 and 32 bytes from a string of length 32 [-Wstringop-truncation]
      27 | #define __underlying_strncpy __builtin_strncpy
         |                              ^
   include/linux/fortify-string.h:38:9: note: in expansion of macro '__underlying_strncpy'
      38 |  return __underlying_strncpy(p, q, size);
         |         ^~~~~~~~~~~~~~~~~~~~


vim +/__builtin_strncpy +27 include/linux/fortify-string.h

     4	
     5	
     6	#if defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KASAN_SW_TAGS)
     7	extern void *__underlying_memchr(const void *p, int c, __kernel_size_t size) __RENAME(memchr);
     8	extern int __underlying_memcmp(const void *p, const void *q, __kernel_size_t size) __RENAME(memcmp);
     9	extern void *__underlying_memcpy(void *p, const void *q, __kernel_size_t size) __RENAME(memcpy);
    10	extern void *__underlying_memmove(void *p, const void *q, __kernel_size_t size) __RENAME(memmove);
    11	extern void *__underlying_memset(void *p, int c, __kernel_size_t size) __RENAME(memset);
    12	extern char *__underlying_strcat(char *p, const char *q) __RENAME(strcat);
    13	extern char *__underlying_strcpy(char *p, const char *q) __RENAME(strcpy);
    14	extern __kernel_size_t __underlying_strlen(const char *p) __RENAME(strlen);
    15	extern char *__underlying_strncat(char *p, const char *q, __kernel_size_t count) __RENAME(strncat);
    16	extern char *__underlying_strncpy(char *p, const char *q, __kernel_size_t size) __RENAME(strncpy);
    17	#else
    18	#define __underlying_memchr	__builtin_memchr
    19	#define __underlying_memcmp	__builtin_memcmp
    20	#define __underlying_memcpy	__builtin_memcpy
    21	#define __underlying_memmove	__builtin_memmove
    22	#define __underlying_memset	__builtin_memset
    23	#define __underlying_strcat	__builtin_strcat
    24	#define __underlying_strcpy	__builtin_strcpy
    25	#define __underlying_strlen	__builtin_strlen
    26	#define __underlying_strncat	__builtin_strncat
  > 27	#define __underlying_strncpy	__builtin_strncpy
    28	#endif
    29	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 33552 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* include/linux/fortify-string.h:27:30: warning: '__builtin_strncpy' output truncated copying between 0 and 32 bytes from a string of length 32
@ 2021-03-03  2:09 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-03-03  2:09 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7a7fd0de4a9804299793e564a555a49c1fc924cb
commit: a28a6e860c6cf231cf3c5171c75c342adcd00406 string.h: move fortified functions definitions in a dedicated header.
date:   4 days ago
config: mips-randconfig-r016-20210302 (attached as .config)
compiler: mipsel-linux-gcc (GCC) 9.3.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/torvalds/linux.git/commit/?id=a28a6e860c6cf231cf3c5171c75c342adcd00406
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout a28a6e860c6cf231cf3c5171c75c342adcd00406
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips 

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

All warnings (new ones prefixed by >>):

   In file included from include/linux/string.h:269,
                    from include/linux/bitmap.h:9,
                    from include/linux/cpumask.h:12,
                    from include/linux/smp.h:13,
                    from arch/mips/include/asm/cpu-type.h:12,
                    from arch/mips/include/asm/timex.h:19,
                    from include/linux/timex.h:65,
                    from include/linux/time32.h:13,
                    from include/linux/time.h:60,
                    from include/linux/stat.h:19,
                    from include/linux/module.h:13,
                    from lib/test_hexdump.c:8:
   In function 'strncpy',
       inlined from 'test_hexdump_prepare_test.isra.0' at lib/test_hexdump.c:116:3:
>> include/linux/fortify-string.h:27:30: warning: '__builtin_strncpy' output truncated copying between 0 and 32 bytes from a string of length 32 [-Wstringop-truncation]
      27 | #define __underlying_strncpy __builtin_strncpy
         |                              ^
   include/linux/fortify-string.h:38:9: note: in expansion of macro '__underlying_strncpy'
      38 |  return __underlying_strncpy(p, q, size);
         |         ^~~~~~~~~~~~~~~~~~~~


vim +/__builtin_strncpy +27 include/linux/fortify-string.h

     4	
     5	
     6	#if defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KASAN_SW_TAGS)
     7	extern void *__underlying_memchr(const void *p, int c, __kernel_size_t size) __RENAME(memchr);
     8	extern int __underlying_memcmp(const void *p, const void *q, __kernel_size_t size) __RENAME(memcmp);
     9	extern void *__underlying_memcpy(void *p, const void *q, __kernel_size_t size) __RENAME(memcpy);
    10	extern void *__underlying_memmove(void *p, const void *q, __kernel_size_t size) __RENAME(memmove);
    11	extern void *__underlying_memset(void *p, int c, __kernel_size_t size) __RENAME(memset);
    12	extern char *__underlying_strcat(char *p, const char *q) __RENAME(strcat);
    13	extern char *__underlying_strcpy(char *p, const char *q) __RENAME(strcpy);
    14	extern __kernel_size_t __underlying_strlen(const char *p) __RENAME(strlen);
    15	extern char *__underlying_strncat(char *p, const char *q, __kernel_size_t count) __RENAME(strncat);
    16	extern char *__underlying_strncpy(char *p, const char *q, __kernel_size_t size) __RENAME(strncpy);
    17	#else
    18	#define __underlying_memchr	__builtin_memchr
    19	#define __underlying_memcmp	__builtin_memcmp
    20	#define __underlying_memcpy	__builtin_memcpy
    21	#define __underlying_memmove	__builtin_memmove
    22	#define __underlying_memset	__builtin_memset
    23	#define __underlying_strcat	__builtin_strcat
    24	#define __underlying_strcpy	__builtin_strcpy
    25	#define __underlying_strlen	__builtin_strlen
    26	#define __underlying_strncat	__builtin_strncat
  > 27	#define __underlying_strncpy	__builtin_strncpy
    28	#endif
    29	

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 33552 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-03 11:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-03  2:09 include/linux/fortify-string.h:27:30: warning: '__builtin_strncpy' output truncated copying between 0 and 32 bytes from a string of length 32 kernel test robot
2021-03-03  2:09 ` kernel test robot

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.