From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [kees:for-next/array-bounds 9/10] arch/sh/kernel/machvec.c:105:33: warning: array subscript 'struct sh_machine_vector[0]' is partly outside array bounds of 'long int[1]'
Date: Tue, 25 Jan 2022 15:35:50 +0800 [thread overview]
Message-ID: <202201251510.55XdBprq-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 4408 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/array-bounds
head: 3ccac0d2ba34a8e6f722975136f06c30fb586ca0
commit: 4ba545781e20f49cf1175e11d9f606e621040acf [9/10] Makefile: Enable -Warray-bounds
config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20220125/202201251510.55XdBprq-lkp(a)intel.com/config)
compiler: sh4-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/kees/linux.git/commit/?id=4ba545781e20f49cf1175e11d9f606e621040acf
git remote add kees https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git
git fetch --no-tags kees for-next/array-bounds
git checkout 4ba545781e20f49cf1175e11d9f606e621040acf
# 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=sh SHELL=/bin/bash arch/sh/kernel/
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 >>):
arch/sh/kernel/machvec.c: In function 'early_parse_mv':
arch/sh/kernel/machvec.c:44:15: warning: variable 'mv_comma' set but not used [-Wunused-but-set-variable]
44 | char *mv_comma;
| ^~~~~~~~
arch/sh/kernel/machvec.c: In function 'sh_mv_setup':
>> arch/sh/kernel/machvec.c:105:33: warning: array subscript 'struct sh_machine_vector[0]' is partly outside array bounds of 'long int[1]' [-Warray-bounds]
105 | sh_mv = *(struct sh_machine_vector *)&__machvec_start;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from arch/sh/kernel/machvec.c:13:
arch/sh/include/asm/sections.h:7:13: note: while referencing '__machvec_start'
7 | extern long __machvec_start, __machvec_end;
| ^~~~~~~~~~~~~~~
vim +105 arch/sh/kernel/machvec.c
9655ad03af2d23 Paul Mundt 2007-05-14 80
9655ad03af2d23 Paul Mundt 2007-05-14 81 void __init sh_mv_setup(void)
9655ad03af2d23 Paul Mundt 2007-05-14 82 {
82f81f4784479d Paul Mundt 2007-05-15 83 /*
82f81f4784479d Paul Mundt 2007-05-15 84 * Only overload the machvec if one hasn't been selected on
82f81f4784479d Paul Mundt 2007-05-15 85 * the command line with sh_mv=
82f81f4784479d Paul Mundt 2007-05-15 86 */
fd8f20e8e2f8f1 Paul Mundt 2007-05-15 87 if (!machvec_selected) {
82f81f4784479d Paul Mundt 2007-05-15 88 unsigned long machvec_size;
82f81f4784479d Paul Mundt 2007-05-15 89
82f81f4784479d Paul Mundt 2007-05-15 90 machvec_size = ((unsigned long)&__machvec_end -
82f81f4784479d Paul Mundt 2007-05-15 91 (unsigned long)&__machvec_start);
82f81f4784479d Paul Mundt 2007-05-15 92
5556410e220387 Paul Mundt 2007-08-07 93 /*
5556410e220387 Paul Mundt 2007-08-07 94 * Sanity check for machvec section alignment. Ensure
5556410e220387 Paul Mundt 2007-08-07 95 * __initmv hasn't been misused.
5556410e220387 Paul Mundt 2007-08-07 96 */
5556410e220387 Paul Mundt 2007-08-07 97 if (machvec_size % sizeof(struct sh_machine_vector))
5556410e220387 Paul Mundt 2007-08-07 98 panic("machvec misaligned, invalid __initmv use?");
5556410e220387 Paul Mundt 2007-08-07 99
82f81f4784479d Paul Mundt 2007-05-15 100 /*
82f81f4784479d Paul Mundt 2007-05-15 101 * If the machvec hasn't been preselected, use the first
82f81f4784479d Paul Mundt 2007-05-15 102 * vector (usually the only one) from .machvec.init.
82f81f4784479d Paul Mundt 2007-05-15 103 */
82f81f4784479d Paul Mundt 2007-05-15 104 if (machvec_size >= sizeof(struct sh_machine_vector))
82f81f4784479d Paul Mundt 2007-05-15 @105 sh_mv = *(struct sh_machine_vector *)&__machvec_start;
:::::: The code at line 105 was first introduced by commit
:::::: 82f81f4784479df17a80caff4a7156da0a2f7dea sh: Kill off machvec aliases.
:::::: TO: Paul Mundt <lethal@linux-sh.org>
:::::: CC: Paul Mundt <lethal@hera.kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Kees Cook <keescook@chromium.org>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
"Gustavo A. R. Silva" <gustavoars@kernel.org>
Subject: [kees:for-next/array-bounds 9/10] arch/sh/kernel/machvec.c:105:33: warning: array subscript 'struct sh_machine_vector[0]' is partly outside array bounds of 'long int[1]'
Date: Tue, 25 Jan 2022 15:35:50 +0800 [thread overview]
Message-ID: <202201251510.55XdBprq-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/array-bounds
head: 3ccac0d2ba34a8e6f722975136f06c30fb586ca0
commit: 4ba545781e20f49cf1175e11d9f606e621040acf [9/10] Makefile: Enable -Warray-bounds
config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20220125/202201251510.55XdBprq-lkp@intel.com/config)
compiler: sh4-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/kees/linux.git/commit/?id=4ba545781e20f49cf1175e11d9f606e621040acf
git remote add kees https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git
git fetch --no-tags kees for-next/array-bounds
git checkout 4ba545781e20f49cf1175e11d9f606e621040acf
# 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=sh SHELL=/bin/bash arch/sh/kernel/
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 >>):
arch/sh/kernel/machvec.c: In function 'early_parse_mv':
arch/sh/kernel/machvec.c:44:15: warning: variable 'mv_comma' set but not used [-Wunused-but-set-variable]
44 | char *mv_comma;
| ^~~~~~~~
arch/sh/kernel/machvec.c: In function 'sh_mv_setup':
>> arch/sh/kernel/machvec.c:105:33: warning: array subscript 'struct sh_machine_vector[0]' is partly outside array bounds of 'long int[1]' [-Warray-bounds]
105 | sh_mv = *(struct sh_machine_vector *)&__machvec_start;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from arch/sh/kernel/machvec.c:13:
arch/sh/include/asm/sections.h:7:13: note: while referencing '__machvec_start'
7 | extern long __machvec_start, __machvec_end;
| ^~~~~~~~~~~~~~~
vim +105 arch/sh/kernel/machvec.c
9655ad03af2d23 Paul Mundt 2007-05-14 80
9655ad03af2d23 Paul Mundt 2007-05-14 81 void __init sh_mv_setup(void)
9655ad03af2d23 Paul Mundt 2007-05-14 82 {
82f81f4784479d Paul Mundt 2007-05-15 83 /*
82f81f4784479d Paul Mundt 2007-05-15 84 * Only overload the machvec if one hasn't been selected on
82f81f4784479d Paul Mundt 2007-05-15 85 * the command line with sh_mv=
82f81f4784479d Paul Mundt 2007-05-15 86 */
fd8f20e8e2f8f1 Paul Mundt 2007-05-15 87 if (!machvec_selected) {
82f81f4784479d Paul Mundt 2007-05-15 88 unsigned long machvec_size;
82f81f4784479d Paul Mundt 2007-05-15 89
82f81f4784479d Paul Mundt 2007-05-15 90 machvec_size = ((unsigned long)&__machvec_end -
82f81f4784479d Paul Mundt 2007-05-15 91 (unsigned long)&__machvec_start);
82f81f4784479d Paul Mundt 2007-05-15 92
5556410e220387 Paul Mundt 2007-08-07 93 /*
5556410e220387 Paul Mundt 2007-08-07 94 * Sanity check for machvec section alignment. Ensure
5556410e220387 Paul Mundt 2007-08-07 95 * __initmv hasn't been misused.
5556410e220387 Paul Mundt 2007-08-07 96 */
5556410e220387 Paul Mundt 2007-08-07 97 if (machvec_size % sizeof(struct sh_machine_vector))
5556410e220387 Paul Mundt 2007-08-07 98 panic("machvec misaligned, invalid __initmv use?");
5556410e220387 Paul Mundt 2007-08-07 99
82f81f4784479d Paul Mundt 2007-05-15 100 /*
82f81f4784479d Paul Mundt 2007-05-15 101 * If the machvec hasn't been preselected, use the first
82f81f4784479d Paul Mundt 2007-05-15 102 * vector (usually the only one) from .machvec.init.
82f81f4784479d Paul Mundt 2007-05-15 103 */
82f81f4784479d Paul Mundt 2007-05-15 104 if (machvec_size >= sizeof(struct sh_machine_vector))
82f81f4784479d Paul Mundt 2007-05-15 @105 sh_mv = *(struct sh_machine_vector *)&__machvec_start;
:::::: The code at line 105 was first introduced by commit
:::::: 82f81f4784479df17a80caff4a7156da0a2f7dea sh: Kill off machvec aliases.
:::::: TO: Paul Mundt <lethal@linux-sh.org>
:::::: CC: Paul Mundt <lethal@hera.kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
next reply other threads:[~2022-01-25 7:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-25 7:35 kernel test robot [this message]
2022-01-25 7:35 ` [kees:for-next/array-bounds 9/10] arch/sh/kernel/machvec.c:105:33: warning: array subscript 'struct sh_machine_vector[0]' is partly outside array bounds of 'long int[1]' kernel test robot
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=202201251510.55XdBprq-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.