From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D1D0C433EF for ; Wed, 15 Dec 2021 00:02:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 69B656B0071; Tue, 14 Dec 2021 19:02:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 64A756B0073; Tue, 14 Dec 2021 19:02:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5121A6B0074; Tue, 14 Dec 2021 19:02:27 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0156.hostedemail.com [216.40.44.156]) by kanga.kvack.org (Postfix) with ESMTP id 42BEF6B0071 for ; Tue, 14 Dec 2021 19:02:27 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id EAC948632F for ; Wed, 15 Dec 2021 00:02:16 +0000 (UTC) X-FDA: 78918076314.06.DB7DEFA Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by imf24.hostedemail.com (Postfix) with ESMTP id E4DDD180019 for ; Wed, 15 Dec 2021 00:02:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1639526533; x=1671062533; h=date:from:to:cc:subject:message-id:mime-version; bh=VSXgUDdlFqKGlsS399TSciH7lt+O61I9XZ0vqoofX54=; b=LcysE4nI7kIWhZEKOt6JKri3UC97vAgfg5LVK6xP0TwsYLIRwFmvGLpe 0kbvzpIL6oxOANbPj4LhAHlQ+3hXhMG5SVd8lJotTv77HR3nKjAxJBbwD z57xaFNfJhw2x8BshPS3CmnA38wEuZoX/6bss1jLCk9STGFeIcpmcXPag g+JrYNVhaJRUtYCYcqvEALgbvQsbNcY5xenjHUUvuOPyN9vZHrxVPwWKr NeslPxwoalBD3lCFp1D9xGrMV8+skXuZTCXl+D2L6vNO4QwlWtpQV3ta+ RBv4oFj+rgAyWwM3pp6lAAZWRKjbI2k1jktzV5R2poBnvCJZDfUWRb8Ls g==; X-IronPort-AV: E=McAfee;i="6200,9189,10197"; a="299887255" X-IronPort-AV: E=Sophos;i="5.88,206,1635231600"; d="scan'208";a="299887255" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2021 16:01:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,206,1635231600"; d="scan'208";a="753160672" Received: from lkp-server02.sh.intel.com (HELO 9f38c0981d9f) ([10.239.97.151]) by fmsmga006.fm.intel.com with ESMTP; 14 Dec 2021 16:01:35 -0800 Received: from kbuild by 9f38c0981d9f with local (Exim 4.92) (envelope-from ) id 1mxHjj-0000x2-3o; Wed, 15 Dec 2021 00:01:35 +0000 Date: Wed, 15 Dec 2021 08:00:36 +0800 From: kernel test robot To: Francis Laniel Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org, Andrew Morton , Linux Memory Management List Subject: include/linux/fortify-string.h:27:33: warning: '__builtin_strncpy' output may be truncated copying between 5 and 9 bytes from a string of length 9 Message-ID: <202112150718.rMIimid9-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: E4DDD180019 X-Stat-Signature: qef8bkbpameokaiuqzp3uzqz98zhp8n8 Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=LcysE4nI; spf=none (imf24.hostedemail.com: domain of lkp@intel.com has no SPF policy when checking 134.134.136.31) smtp.mailfrom=lkp@intel.com; dmarc=pass (policy=none) header.from=intel.com X-HE-Tag: 1639526530-85228 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 5472f14a37421d1bca3dddf33cabd3bd6dbefbbc commit: a28a6e860c6cf231cf3c5171c75c342adcd00406 string.h: move fortified functions definitions in a dedicated header. date: 10 months ago config: mips-randconfig-r011-20211214 (https://download.01.org/0day-ci/archive/20211215/202112150718.rMIimid9-lkp@intel.com/config) compiler: mipsel-linux-gcc (GCC) 11.2.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 config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=mips SHELL=/bin/bash arch/mips/dec/prom/ fs/xfs/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): In file included from include/linux/string.h:269, 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:119:2, inlined from 'xfs_xattr_put_listent' at fs/xfs/xfs_xattr.c:181:2: >> include/linux/fortify-string.h:27:33: warning: '__builtin_strncpy' output may be truncated copying between 5 and 9 bytes from a string of length 9 [-Wstringop-truncation] 27 | #define __underlying_strncpy __builtin_strncpy | ^ include/linux/fortify-string.h:38:16: 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