tree:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
linux-4.4.y
head: 95a3867e897abd7811196123f81a119a75aba863
commit: 7a5c21af789d6871de3f05185e221fb7eea6804b [7532/9999] MIPS: fw: sni: Fix out of
bounds init of o32 stack
config: mips-randconfig-r016-20210209 (attached as .config)
compiler: mips64-linux-gcc (GCC) 7.5.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/stable/linux-stable-rc.gi...
git remote add linux-stable-rc
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git fetch --no-tags linux-stable-rc linux-4.4.y
git checkout 7a5c21af789d6871de3f05185e221fb7eea6804b
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-7.5.0 make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
arch/mips/fw/sni/sniprom.c:67:6: warning: no previous prototype for
'prom_putchar' [-Wmissing-prototypes]
void prom_putchar(char c)
^~~~~~~~~~~~
In file included from include/linux/compiler.h:72:0,
from include/linux/linkage.h:4,
from include/linux/kernel.h:6,
from arch/mips/fw/sni/sniprom.c:12:
arch/mips/fw/sni/sniprom.c: In function 'prom_putchar':
> include/linux/compiler-gcc.h:64:28: error: implicit declaration
of function 'BUILD_BUG_ON_ZERO' [-Werror=implicit-function-declaration]
#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
^
include/linux/kernel.h:54:59: note: in expansion of macro '__must_be_array'
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
^~~~~~~~~~~~~~~
arch/mips/fw/sni/sniprom.c:45:29: note: in expansion of macro 'ARRAY_SIZE'
#define O32_STK (&o32_stk[ARRAY_SIZE(o32_stk)])
^~~~~~~~~~
arch/mips/fw/sni/sniprom.c:55:62: note: in expansion of macro 'O32_STK'
#define _prom_putchar(x) __prom_putchar(___prom_putchar, O32_STK, x)
^~~~~~~
arch/mips/fw/sni/sniprom.c:69:2: note: in expansion of macro '_prom_putchar'
_prom_putchar(c);
^~~~~~~~~~~~~
arch/mips/fw/sni/sniprom.c: At top level:
arch/mips/fw/sni/sniprom.c:78:7: warning: no previous prototype for
'prom_get_hwconf' [-Wmissing-prototypes]
void *prom_get_hwconf(void)
^~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/BUILD_BUG_ON_ZERO +64 include/linux/compiler-gcc.h
a1365647022eb0 Andrew Morton 2006-01-08 55
fe8c8a126806fe Cesar Eduardo Barros 2013-11-25 56 /* Make the optimizer believe the
variable can be manipulated arbitrarily. */
f6d133f877c8bb Joe Perches 2015-06-25 57 #define
OPTIMIZER_HIDE_VAR(var) \
f6d133f877c8bb Joe Perches 2015-06-25 58 __asm__ ("" :
"=r" (var) : "0" (var))
fe8c8a126806fe Cesar Eduardo Barros 2013-11-25 59
5bd7e6a30e1eb3 KOSAKI Motohiro 2011-05-24 60 #ifdef __CHECKER__
f6d133f877c8bb Joe Perches 2015-06-25 61 #define __must_be_array(a) 0
5bd7e6a30e1eb3 KOSAKI Motohiro 2011-05-24 62 #else
c5e631cf65f4d6 Rusty Russell 2007-05-06 63 /* &a[0] degrades to a pointer: a
different type from an array */
ea6b101d8a3ea4 Rusty Russell 2010-08-09 @64 #define
__must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
5bd7e6a30e1eb3 KOSAKI Motohiro 2011-05-24 65 #endif
a1365647022eb0 Andrew Morton 2006-01-08 66
:::::: The code at line 64 was first introduced by commit
:::::: ea6b101d8a3ea4e1dec29df31188c2f9852296fe include/linux/compiler-gcc.h: use
__same_type() in __must_be_array()
:::::: TO: Rusty Russell <rusty(a)rustcorp.com.au>
:::::: CC: Linus Torvalds <torvalds(a)linux-foundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org