From: Kees Cook <keescook@chromium.org>
To: kernel test robot <lkp@intel.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: include/linux/fortify-string.h:52:29: warning: '__builtin_strcpy' source argument is the same as destination
Date: Thu, 30 Nov 2023 14:11:54 -0800 [thread overview]
Message-ID: <202311301409.F2AFF5DA1@keescook> (raw)
In-Reply-To: <202311301039.7i51bZCz-lkp@intel.com>
On Thu, Nov 30, 2023 at 12:02:50PM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 3b47bc037bd44f142ac09848e8d3ecccc726be99
> commit: ba38961a069b0d8d03b53218a6c29d737577d448 um: Enable FORTIFY_SOURCE
> date: 1 year, 3 months ago
> config: um-randconfig-r034-20230830 (https://download.01.org/0day-ci/archive/20231130/202311301039.7i51bZCz-lkp@intel.com/config)
> compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231130/202311301039.7i51bZCz-lkp@intel.com/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 <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202311301039.7i51bZCz-lkp@intel.com/
>
> [...]
> kernel/kallsyms.c: In function '__sprint_symbol.isra.0':
> >> include/linux/fortify-string.h:52:29: warning: '__builtin_strcpy' source argument is the same as destination [-Wrestrict]
> 52 | #define __underlying_strcpy __builtin_strcpy
> | ^
> include/linux/fortify-string.h:567:10: note: in expansion of macro '__underlying_strcpy'
> 567 | return __underlying_strcpy(p, q);
> | ^~~~~~~~~~~~~~~~~~~
The only strcpy() in __sprint_symbol() is:
if (name != buffer)
strcpy(buffer, name);
Which is explicitly not the same address...
This appears to be a GCC 9 false positive, maybe?
--
Kees Cook
next prev parent reply other threads:[~2023-11-30 22:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-30 4:02 include/linux/fortify-string.h:52:29: warning: '__builtin_strcpy' source argument is the same as destination kernel test robot
2023-11-30 22:11 ` Kees Cook [this message]
2023-12-20 6:20 ` Yujie Liu
2023-12-20 6:42 ` Yujie Liu
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=202311301409.F2AFF5DA1@keescook \
--to=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
/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