public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
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/sparc/kernel/irq_32.c:258:7: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]'
Date: Thu, 15 Jul 2021 20:20:43 +0800	[thread overview]
Message-ID: <202107152028.dCYuIsz3-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 14807 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: sparc-randconfig-p002-20210715 (attached as .config)
compiler: sparc-linux-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=sparc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   arch/sparc/kernel/irq_32.c: In function 'sparc_floppy_request_irq':
>> arch/sparc/kernel/irq_32.c:258:7: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
     258 |  table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_one = SPARC_RD_PSR_L0; \
         |       ^
   arch/sparc/kernel/irq_32.c:272:3: note: in expansion of macro 'INSTANTIATE'
     272 |   INSTANTIATE(trap_table)
         |   ^~~~~~~~~~~
   In file included from arch/sparc/kernel/irq_32.c:25:
   arch/sparc/kernel/kernel.h:143:24: note: while referencing 'trapbase_cpu1'
     143 | extern struct tt_entry trapbase_cpu1;
         |                        ^~~~~~~~~~~~~
   In file included from arch/sparc/include/asm/traps.h:10,
                    from arch/sparc/kernel/kernel.h:8,
                    from arch/sparc/kernel/irq_32.c:25:
   arch/sparc/kernel/irq_32.c:261:25: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
     261 |         (unsigned long) &table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_two);\
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/sparc/include/uapi/asm/traps.h:27:38: note: in definition of macro 'SPARC_BRANCH'
      27 |           (0x10800000 | (((dest_addr-inst_addr)>>2)&0x3fffff))
         |                                      ^~~~~~~~~
   arch/sparc/kernel/irq_32.c:272:3: note: in expansion of macro 'INSTANTIATE'
     272 |   INSTANTIATE(trap_table)
         |   ^~~~~~~~~~~
   In file included from arch/sparc/kernel/irq_32.c:25:
   arch/sparc/kernel/kernel.h:143:24: note: while referencing 'trapbase_cpu1'
     143 | extern struct tt_entry trapbase_cpu1;
         |                        ^~~~~~~~~~~~~
   arch/sparc/kernel/irq_32.c:259:7: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
     259 |  table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_two = \
         |       ^
   arch/sparc/kernel/irq_32.c:272:3: note: in expansion of macro 'INSTANTIATE'
     272 |   INSTANTIATE(trap_table)
         |   ^~~~~~~~~~~
   In file included from arch/sparc/kernel/irq_32.c:25:
   arch/sparc/kernel/kernel.h:143:24: note: while referencing 'trapbase_cpu1'
     143 | extern struct tt_entry trapbase_cpu1;
         |                        ^~~~~~~~~~~~~
   arch/sparc/kernel/irq_32.c:262:7: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
     262 |  table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_three = SPARC_RD_WIM_L3; \
         |       ^
   arch/sparc/kernel/irq_32.c:272:3: note: in expansion of macro 'INSTANTIATE'
     272 |   INSTANTIATE(trap_table)
         |   ^~~~~~~~~~~
   In file included from arch/sparc/kernel/irq_32.c:25:
   arch/sparc/kernel/kernel.h:143:24: note: while referencing 'trapbase_cpu1'
     143 | extern struct tt_entry trapbase_cpu1;
         |                        ^~~~~~~~~~~~~
   arch/sparc/kernel/irq_32.c:263:7: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
     263 |  table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_four = SPARC_NOP;
         |       ^
   arch/sparc/kernel/irq_32.c:272:3: note: in expansion of macro 'INSTANTIATE'
     272 |   INSTANTIATE(trap_table)
         |   ^~~~~~~~~~~
   In file included from arch/sparc/kernel/irq_32.c:25:
   arch/sparc/kernel/kernel.h:143:24: note: while referencing 'trapbase_cpu1'
     143 | extern struct tt_entry trapbase_cpu1;
         |                        ^~~~~~~~~~~~~
>> arch/sparc/kernel/irq_32.c:258:7: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
     258 |  table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_one = SPARC_RD_PSR_L0; \
         |       ^
   arch/sparc/kernel/irq_32.c:274:3: note: in expansion of macro 'INSTANTIATE'
     274 |   INSTANTIATE(trap_table)
         |   ^~~~~~~~~~~
   In file included from arch/sparc/kernel/irq_32.c:25:
   arch/sparc/kernel/kernel.h:144:24: note: while referencing 'trapbase_cpu2'
     144 | extern struct tt_entry trapbase_cpu2;
         |                        ^~~~~~~~~~~~~
   In file included from arch/sparc/include/asm/traps.h:10,
                    from arch/sparc/kernel/kernel.h:8,
                    from arch/sparc/kernel/irq_32.c:25:
   arch/sparc/kernel/irq_32.c:261:25: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
     261 |         (unsigned long) &table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_two);\
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/sparc/include/uapi/asm/traps.h:27:38: note: in definition of macro 'SPARC_BRANCH'
      27 |           (0x10800000 | (((dest_addr-inst_addr)>>2)&0x3fffff))
         |                                      ^~~~~~~~~
   arch/sparc/kernel/irq_32.c:274:3: note: in expansion of macro 'INSTANTIATE'
     274 |   INSTANTIATE(trap_table)
         |   ^~~~~~~~~~~
   In file included from arch/sparc/kernel/irq_32.c:25:
   arch/sparc/kernel/kernel.h:144:24: note: while referencing 'trapbase_cpu2'
     144 | extern struct tt_entry trapbase_cpu2;
         |                        ^~~~~~~~~~~~~
   arch/sparc/kernel/irq_32.c:259:7: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
     259 |  table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_two = \
         |       ^
   arch/sparc/kernel/irq_32.c:274:3: note: in expansion of macro 'INSTANTIATE'
     274 |   INSTANTIATE(trap_table)
         |   ^~~~~~~~~~~
   In file included from arch/sparc/kernel/irq_32.c:25:
   arch/sparc/kernel/kernel.h:144:24: note: while referencing 'trapbase_cpu2'
     144 | extern struct tt_entry trapbase_cpu2;
         |                        ^~~~~~~~~~~~~
   arch/sparc/kernel/irq_32.c:262:7: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
     262 |  table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_three = SPARC_RD_WIM_L3; \
         |       ^
   arch/sparc/kernel/irq_32.c:274:3: note: in expansion of macro 'INSTANTIATE'
     274 |   INSTANTIATE(trap_table)
         |   ^~~~~~~~~~~
   In file included from arch/sparc/kernel/irq_32.c:25:
   arch/sparc/kernel/kernel.h:144:24: note: while referencing 'trapbase_cpu2'
     144 | extern struct tt_entry trapbase_cpu2;
         |                        ^~~~~~~~~~~~~
   arch/sparc/kernel/irq_32.c:263:7: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
     263 |  table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_four = SPARC_NOP;
         |       ^
   arch/sparc/kernel/irq_32.c:274:3: note: in expansion of macro 'INSTANTIATE'
     274 |   INSTANTIATE(trap_table)
         |   ^~~~~~~~~~~
   In file included from arch/sparc/kernel/irq_32.c:25:
   arch/sparc/kernel/kernel.h:144:24: note: while referencing 'trapbase_cpu2'
     144 | extern struct tt_entry trapbase_cpu2;
         |                        ^~~~~~~~~~~~~
>> arch/sparc/kernel/irq_32.c:258:7: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
     258 |  table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_one = SPARC_RD_PSR_L0; \
         |       ^
   arch/sparc/kernel/irq_32.c:276:3: note: in expansion of macro 'INSTANTIATE'
     276 |   INSTANTIATE(trap_table)
         |   ^~~~~~~~~~~
   In file included from arch/sparc/kernel/irq_32.c:25:
   arch/sparc/kernel/kernel.h:145:24: note: while referencing 'trapbase_cpu3'
     145 | extern struct tt_entry trapbase_cpu3;
         |                        ^~~~~~~~~~~~~
   In file included from arch/sparc/include/asm/traps.h:10,
                    from arch/sparc/kernel/kernel.h:8,
                    from arch/sparc/kernel/irq_32.c:25:
   arch/sparc/kernel/irq_32.c:261:25: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
     261 |         (unsigned long) &table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_two);\
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/sparc/include/uapi/asm/traps.h:27:38: note: in definition of macro 'SPARC_BRANCH'
      27 |           (0x10800000 | (((dest_addr-inst_addr)>>2)&0x3fffff))
         |                                      ^~~~~~~~~
   arch/sparc/kernel/irq_32.c:276:3: note: in expansion of macro 'INSTANTIATE'
     276 |   INSTANTIATE(trap_table)
         |   ^~~~~~~~~~~
   In file included from arch/sparc/kernel/irq_32.c:25:
   arch/sparc/kernel/kernel.h:145:24: note: while referencing 'trapbase_cpu3'
     145 | extern struct tt_entry trapbase_cpu3;
         |                        ^~~~~~~~~~~~~
   arch/sparc/kernel/irq_32.c:259:7: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
     259 |  table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_two = \
         |       ^
   arch/sparc/kernel/irq_32.c:276:3: note: in expansion of macro 'INSTANTIATE'
     276 |   INSTANTIATE(trap_table)
         |   ^~~~~~~~~~~
   In file included from arch/sparc/kernel/irq_32.c:25:
   arch/sparc/kernel/kernel.h:145:24: note: while referencing 'trapbase_cpu3'
     145 | extern struct tt_entry trapbase_cpu3;
         |                        ^~~~~~~~~~~~~
   arch/sparc/kernel/irq_32.c:262:7: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
     262 |  table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_three = SPARC_RD_WIM_L3; \
         |       ^
   arch/sparc/kernel/irq_32.c:276:3: note: in expansion of macro 'INSTANTIATE'
     276 |   INSTANTIATE(trap_table)
         |   ^~~~~~~~~~~
   In file included from arch/sparc/kernel/irq_32.c:25:
   arch/sparc/kernel/kernel.h:145:24: note: while referencing 'trapbase_cpu3'
     145 | extern struct tt_entry trapbase_cpu3;
         |                        ^~~~~~~~~~~~~
   arch/sparc/kernel/irq_32.c:263:7: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
     263 |  table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_four = SPARC_NOP;
         |       ^
   arch/sparc/kernel/irq_32.c:276:3: note: in expansion of macro 'INSTANTIATE'
     276 |   INSTANTIATE(trap_table)
         |   ^~~~~~~~~~~
   In file included from arch/sparc/kernel/irq_32.c:25:
   arch/sparc/kernel/kernel.h:145:24: note: while referencing 'trapbase_cpu3'
     145 | extern struct tt_entry trapbase_cpu3;
         |                        ^~~~~~~~~~~~~
   cc1: all warnings being treated as errors


vim +258 arch/sparc/kernel/irq_32.c

^1da177e4c3f41 arch/sparc/kernel/irq.c    Linus Torvalds 2005-04-16  240  
6baa9b20a68a88 arch/sparc/kernel/irq_32.c Sam Ravnborg   2011-04-18  241  int sparc_floppy_request_irq(unsigned int irq, irq_handler_t irq_handler)
^1da177e4c3f41 arch/sparc/kernel/irq.c    Linus Torvalds 2005-04-16  242  {
^1da177e4c3f41 arch/sparc/kernel/irq.c    Linus Torvalds 2005-04-16  243  	unsigned int cpu_irq;
6baa9b20a68a88 arch/sparc/kernel/irq_32.c Sam Ravnborg   2011-04-18  244  	int err;
6baa9b20a68a88 arch/sparc/kernel/irq_32.c Sam Ravnborg   2011-04-18  245  
^1da177e4c3f41 arch/sparc/kernel/irq.c    Linus Torvalds 2005-04-16  246  
6baa9b20a68a88 arch/sparc/kernel/irq_32.c Sam Ravnborg   2011-04-18  247  	err = request_irq(irq, irq_handler, 0, "floppy", NULL);
6baa9b20a68a88 arch/sparc/kernel/irq_32.c Sam Ravnborg   2011-04-18  248  	if (err)
6baa9b20a68a88 arch/sparc/kernel/irq_32.c Sam Ravnborg   2011-04-18  249  		return -1;
^1da177e4c3f41 arch/sparc/kernel/irq.c    Linus Torvalds 2005-04-16  250  
6baa9b20a68a88 arch/sparc/kernel/irq_32.c Sam Ravnborg   2011-04-18  251  	/* Save for later use in floppy interrupt handler */
6baa9b20a68a88 arch/sparc/kernel/irq_32.c Sam Ravnborg   2011-04-18  252  	floppy_irq = irq;
^1da177e4c3f41 arch/sparc/kernel/irq.c    Linus Torvalds 2005-04-16  253  
6baa9b20a68a88 arch/sparc/kernel/irq_32.c Sam Ravnborg   2011-04-18  254  	cpu_irq = (irq & (NR_IRQS - 1));
^1da177e4c3f41 arch/sparc/kernel/irq.c    Linus Torvalds 2005-04-16  255  
^1da177e4c3f41 arch/sparc/kernel/irq.c    Linus Torvalds 2005-04-16  256  	/* Dork with trap table if we get this far. */
^1da177e4c3f41 arch/sparc/kernel/irq.c    Linus Torvalds 2005-04-16  257  #define INSTANTIATE(table) \
^1da177e4c3f41 arch/sparc/kernel/irq.c    Linus Torvalds 2005-04-16 @258  	table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_one = SPARC_RD_PSR_L0; \
^1da177e4c3f41 arch/sparc/kernel/irq.c    Linus Torvalds 2005-04-16  259  	table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_two = \
6baa9b20a68a88 arch/sparc/kernel/irq_32.c Sam Ravnborg   2011-04-18  260  		SPARC_BRANCH((unsigned long) floppy_hardint, \
^1da177e4c3f41 arch/sparc/kernel/irq.c    Linus Torvalds 2005-04-16  261  			     (unsigned long) &table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_two);\
^1da177e4c3f41 arch/sparc/kernel/irq.c    Linus Torvalds 2005-04-16  262  	table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_three = SPARC_RD_WIM_L3; \
^1da177e4c3f41 arch/sparc/kernel/irq.c    Linus Torvalds 2005-04-16  263  	table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_four = SPARC_NOP;
^1da177e4c3f41 arch/sparc/kernel/irq.c    Linus Torvalds 2005-04-16  264  
^1da177e4c3f41 arch/sparc/kernel/irq.c    Linus Torvalds 2005-04-16  265  	INSTANTIATE(sparc_ttable)
b08b5c9c9b35c9 arch/sparc/kernel/irq_32.c Sam Ravnborg   2012-05-25  266  

:::::: The code at line 258 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: 32746 bytes --]

                 reply	other threads:[~2021-07-15 12:21 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=202107152028.dCYuIsz3-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