From: kernel test robot <lkp@intel.com>
To: Francis Laniel <laniel_francis@privacyrequired.com>
Cc: kbuild-all@lists.01.org,
Linux Memory Management List <linux-mm@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [linux-next:master 12407/12657] include/linux/fortify-string.h:27:30: warning: '__builtin_strncpy' output may be truncated copying between 5 and 9 bytes from a string of length 9
Date: Fri, 26 Feb 2021 15:57:51 +0800 [thread overview]
Message-ID: <202102261542.172STKjA-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 3649 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: d01f2f7e35573049673b71e18be7abfe3f80323f
commit: 7adafccdc8693db2cd0a2eae9a21619347b55ca1 [12407/12657] string.h: move fortified functions definitions in a dedicated header.
config: i386-randconfig-r031-20210225 (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/next/linux-next.git/commit/?id=7adafccdc8693db2cd0a2eae9a21619347b55ca1
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout 7adafccdc8693db2cd0a2eae9a21619347b55ca1
# 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@intel.com>
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:30: 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: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: 29788 bytes --]
reply other threads:[~2021-02-26 7:58 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202102261542.172STKjA-lkp@intel.com \
--to=lkp@intel.com \
--cc=akpm@linux-foundation.org \
--cc=kbuild-all@lists.01.org \
--cc=laniel_francis@privacyrequired.com \
--cc=linux-mm@kvack.org \
/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