tree:
https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git
xfs-5.12-merge
head: 45d6842f11a30d152b849ca819a91331b5f94f56
commit: ff344abb1b45079f292cf90e039ce0c5f7ee9988 [2/6] xfs: don't crash with assfail
config: i386-randconfig-a001-20210118 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
#
https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git/comm...
git remote add djwong-xfs
https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git
git fetch --no-tags djwong-xfs xfs-5.12-merge
git checkout ff344abb1b45079f292cf90e039ce0c5f7ee9988
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/linux/uuid.h:12,
from fs/xfs/xfs_linux.h:10,
from fs/xfs/xfs.h:22,
from fs/xfs/xfs_xattr.c:7:
In function 'strncpy',
inlined from '__xfs_xattr_put_listent' at fs/xfs/xfs_xattr.c:118:2,
inlined from 'xfs_xattr_put_listent' at fs/xfs/xfs_xattr.c:180:2:
> include/linux/string.h:291:30: error: '__builtin_strncpy'
output may be truncated copying between 5 and 9 bytes from a string of length 9
[-Werror=stringop-truncation]
291 | #define __underlying_strncpy
__builtin_strncpy
| ^
include/linux/string.h:301:9: note: in expansion of macro
'__underlying_strncpy'
301 | return __underlying_strncpy(p, q, size);
| ^~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
vim +/__builtin_strncpy +291 include/linux/string.h
47227d27e2fcb01a Daniel Axtens 2020-06-03 269
0fea6e9af889f1a4 Andrey Konovalov 2020-12-22 270 #if defined(CONFIG_KASAN_GENERIC) ||
defined(CONFIG_KASAN_SW_TAGS)
47227d27e2fcb01a Daniel Axtens 2020-06-03 271 extern void *__underlying_memchr(const
void *p, int c, __kernel_size_t size) __RENAME(memchr);
47227d27e2fcb01a Daniel Axtens 2020-06-03 272 extern int __underlying_memcmp(const
void *p, const void *q, __kernel_size_t size) __RENAME(memcmp);
47227d27e2fcb01a Daniel Axtens 2020-06-03 273 extern void *__underlying_memcpy(void
*p, const void *q, __kernel_size_t size) __RENAME(memcpy);
47227d27e2fcb01a Daniel Axtens 2020-06-03 274 extern void *__underlying_memmove(void
*p, const void *q, __kernel_size_t size) __RENAME(memmove);
47227d27e2fcb01a Daniel Axtens 2020-06-03 275 extern void *__underlying_memset(void
*p, int c, __kernel_size_t size) __RENAME(memset);
47227d27e2fcb01a Daniel Axtens 2020-06-03 276 extern char *__underlying_strcat(char
*p, const char *q) __RENAME(strcat);
47227d27e2fcb01a Daniel Axtens 2020-06-03 277 extern char *__underlying_strcpy(char
*p, const char *q) __RENAME(strcpy);
47227d27e2fcb01a Daniel Axtens 2020-06-03 278 extern __kernel_size_t
__underlying_strlen(const char *p) __RENAME(strlen);
47227d27e2fcb01a Daniel Axtens 2020-06-03 279 extern char *__underlying_strncat(char
*p, const char *q, __kernel_size_t count) __RENAME(strncat);
47227d27e2fcb01a Daniel Axtens 2020-06-03 280 extern char *__underlying_strncpy(char
*p, const char *q, __kernel_size_t size) __RENAME(strncpy);
47227d27e2fcb01a Daniel Axtens 2020-06-03 281 #else
47227d27e2fcb01a Daniel Axtens 2020-06-03 282 #define
__underlying_memchr __builtin_memchr
47227d27e2fcb01a Daniel Axtens 2020-06-03 283 #define
__underlying_memcmp __builtin_memcmp
47227d27e2fcb01a Daniel Axtens 2020-06-03 284 #define
__underlying_memcpy __builtin_memcpy
47227d27e2fcb01a Daniel Axtens 2020-06-03 285 #define
__underlying_memmove __builtin_memmove
47227d27e2fcb01a Daniel Axtens 2020-06-03 286 #define
__underlying_memset __builtin_memset
47227d27e2fcb01a Daniel Axtens 2020-06-03 287 #define
__underlying_strcat __builtin_strcat
47227d27e2fcb01a Daniel Axtens 2020-06-03 288 #define
__underlying_strcpy __builtin_strcpy
47227d27e2fcb01a Daniel Axtens 2020-06-03 289 #define
__underlying_strlen __builtin_strlen
47227d27e2fcb01a Daniel Axtens 2020-06-03 290 #define
__underlying_strncat __builtin_strncat
47227d27e2fcb01a Daniel Axtens 2020-06-03 @291 #define
__underlying_strncpy __builtin_strncpy
47227d27e2fcb01a Daniel Axtens 2020-06-03 292 #endif
47227d27e2fcb01a Daniel Axtens 2020-06-03 293
:::::: The code at line 291 was first introduced by commit
:::::: 47227d27e2fcb01a9e8f5958d8997cf47a820afc string.h: fix incompatibility between
FORTIFY_SOURCE and KASAN
:::::: TO: Daniel Axtens <dja(a)axtens.net>
:::::: CC: Linus Torvalds <torvalds(a)linux-foundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org