From: kernel test robot <lkp@intel.com>
To: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: kbuild-all@lists.01.org,
"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
LKML <linux-kernel@vger.kernel.org>,
Kees Cook <keescook@chromium.org>
Subject: [gustavoars-linux:for-next/Warray-bounds 1/1] arch/arm/kernel/atags_compat.c:200:2: warning: 'strcpy' offset 364 from the object at 'tags' is out of the bounds of referenced subobject 'cmdline' with type 'char[1]' at offset 364
Date: Thu, 15 Jul 2021 18:36:27 +0800 [thread overview]
Message-ID: <202107151807.0WJnen0g-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 4243 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git for-next/Warray-bounds
head: 0d6455c92b82b36e29e5206a46329058d75fbc33
commit: 0d6455c92b82b36e29e5206a46329058d75fbc33 [1/1] Makefile: Enable -Warray-bounds
config: arm-randconfig-r035-20210715 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 10.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/gustavoars/linux.git/commit/?id=0d6455c92b82b36e29e5206a46329058d75fbc33
git remote add gustavoars-linux https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git
git fetch --no-tags gustavoars-linux for-next/Warray-bounds
git checkout 0d6455c92b82b36e29e5206a46329058d75fbc33
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross ARCH=arm
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 function 'build_tag_list',
inlined from 'convert_to_tag_list' at arch/arm/kernel/atags_compat.c:213:2:
>> arch/arm/kernel/atags_compat.c:200:2: warning: 'strcpy' offset 364 from the object at 'tags' is out of the bounds of referenced subobject 'cmdline' with type 'char[1]' at offset 364 [-Warray-bounds]
200 | strcpy(tag->u.cmdline.cmdline, params->commandline);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from arch/arm/include/asm/setup.h:14,
from arch/arm/kernel/atags_compat.c:20:
arch/arm/kernel/atags_compat.c: In function 'convert_to_tag_list':
arch/arm/include/uapi/asm/setup.h:127:7: note: subobject 'cmdline' declared here
127 | char cmdline[1]; /* this is the minimum size */
| ^~~~~~~
vim +200 arch/arm/kernel/atags_compat.c
^1da177e4c3f41 arch/arm/kernel/compat.c Linus Torvalds 2005-04-16 195
^1da177e4c3f41 arch/arm/kernel/compat.c Linus Torvalds 2005-04-16 196 tag = tag_next(tag);
^1da177e4c3f41 arch/arm/kernel/compat.c Linus Torvalds 2005-04-16 197 tag->hdr.tag = ATAG_CMDLINE;
^1da177e4c3f41 arch/arm/kernel/compat.c Linus Torvalds 2005-04-16 198 tag->hdr.size = (strlen(params->commandline) + 3 +
^1da177e4c3f41 arch/arm/kernel/compat.c Linus Torvalds 2005-04-16 199 sizeof(struct tag_header)) >> 2;
^1da177e4c3f41 arch/arm/kernel/compat.c Linus Torvalds 2005-04-16 @200 strcpy(tag->u.cmdline.cmdline, params->commandline);
^1da177e4c3f41 arch/arm/kernel/compat.c Linus Torvalds 2005-04-16 201
^1da177e4c3f41 arch/arm/kernel/compat.c Linus Torvalds 2005-04-16 202 tag = tag_next(tag);
^1da177e4c3f41 arch/arm/kernel/compat.c Linus Torvalds 2005-04-16 203 tag->hdr.tag = ATAG_NONE;
^1da177e4c3f41 arch/arm/kernel/compat.c Linus Torvalds 2005-04-16 204 tag->hdr.size = 0;
^1da177e4c3f41 arch/arm/kernel/compat.c Linus Torvalds 2005-04-16 205
^1da177e4c3f41 arch/arm/kernel/compat.c Linus Torvalds 2005-04-16 206 memmove(params, taglist, ((int)tag) - ((int)taglist) +
^1da177e4c3f41 arch/arm/kernel/compat.c Linus Torvalds 2005-04-16 207 sizeof(struct tag_header));
^1da177e4c3f41 arch/arm/kernel/compat.c Linus Torvalds 2005-04-16 208 }
^1da177e4c3f41 arch/arm/kernel/compat.c Linus Torvalds 2005-04-16 209
^1da177e4c3f41 arch/arm/kernel/compat.c Linus Torvalds 2005-04-16 210 void __init convert_to_tag_list(struct tag *tags)
^1da177e4c3f41 arch/arm/kernel/compat.c Linus Torvalds 2005-04-16 211 {
^1da177e4c3f41 arch/arm/kernel/compat.c Linus Torvalds 2005-04-16 212 struct param_struct *params = (struct param_struct *)tags;
^1da177e4c3f41 arch/arm/kernel/compat.c Linus Torvalds 2005-04-16 @213 build_tag_list(params, ¶ms->u2);
:::::: The code at line 200 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2
:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>
---
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: 20158 bytes --]
reply other threads:[~2021-07-15 10:36 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=202107151807.0WJnen0g-lkp@intel.com \
--to=lkp@intel.com \
--cc=gustavo@embeddedor.com \
--cc=gustavoars@kernel.org \
--cc=kbuild-all@lists.01.org \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®