tree:
https://github.com/hnaz/linux-mm master
head: 12891f829e4851b3562ddcde27a4a9ade308ada3
commit: 161b082aa6ac5047f1b0f243f0e834d2bfb39842 [179/239] kernel.h: split out panic and
oops helpers
config: nds32-defconfig (attached as .config)
compiler: nds32le-linux-gcc (GCC) 9.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://github.com/hnaz/linux-mm/commit/161b082aa6ac5047f1b0f243f0e834d2b...
git remote add hnaz-linux-mm
https://github.com/hnaz/linux-mm
git fetch --no-tags hnaz-linux-mm master
git checkout 161b082aa6ac5047f1b0f243f0e834d2bfb39842
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=nds32
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Note: the hnaz-linux-mm/master HEAD 12891f829e4851b3562ddcde27a4a9ade308ada3 builds fine.
It only hurts bisectibility.
All errors (new ones prefixed by >>):
In file included from ./arch/nds32/include/generated/asm/bug.h:1,
from include/linux/bug.h:5,
from include/linux/thread_info.h:12,
from lib/strncpy_from_user.c:6:
include/linux/thread_info.h: In function 'check_copy_size':
> include/linux/thread_info.h:215:27: error: 'INT_MAX'
undeclared (first use in this function)
215 | if (WARN_ON_ONCE(bytes >
INT_MAX))
| ^~~~~~~
include/asm-generic/bug.h:146:27: note: in definition of macro 'WARN_ON_ONCE'
146 | int __ret_warn_once = !!(condition); \
| ^~~~~~~~~
In file included from lib/strncpy_from_user.c:6:
include/linux/thread_info.h:60:1: note: 'INT_MAX' is defined in header
'<limits.h>'; did you forget to '#include <limits.h>'?
59 | #include <asm/thread_info.h>
+++ |+#include <limits.h>
60 |
In file included from ./arch/nds32/include/generated/asm/bug.h:1,
from include/linux/bug.h:5,
from include/linux/thread_info.h:12,
from lib/strncpy_from_user.c:6:
include/linux/thread_info.h:215:27: note: each undeclared identifier is reported only
once for each function it appears in
215 | if (WARN_ON_ONCE(bytes > INT_MAX))
| ^~~~~~~
include/asm-generic/bug.h:146:27: note: in definition of macro 'WARN_ON_ONCE'
146 | int __ret_warn_once = !!(condition); \
| ^~~~~~~~~
vim +/INT_MAX +215 include/linux/thread_info.h
b0377fedb65280 Al Viro 2017-06-29 201
9dd819a15162f8 Kees Cook 2019-09-25 202 static __always_inline __must_check bool
b0377fedb65280 Al Viro 2017-06-29 203 check_copy_size(const void *addr, size_t bytes,
bool is_source)
b0377fedb65280 Al Viro 2017-06-29 204 {
b0377fedb65280 Al Viro 2017-06-29 205 int sz = __compiletime_object_size(addr);
b0377fedb65280 Al Viro 2017-06-29 206 if (unlikely(sz >= 0 && sz <
bytes)) {
b0377fedb65280 Al Viro 2017-06-29 207 if (!__builtin_constant_p(bytes))
b0377fedb65280 Al Viro 2017-06-29 208 copy_overflow(sz, bytes);
b0377fedb65280 Al Viro 2017-06-29 209 else if (is_source)
b0377fedb65280 Al Viro 2017-06-29 210 __bad_copy_from();
b0377fedb65280 Al Viro 2017-06-29 211 else
b0377fedb65280 Al Viro 2017-06-29 212 __bad_copy_to();
b0377fedb65280 Al Viro 2017-06-29 213 return false;
b0377fedb65280 Al Viro 2017-06-29 214 }
6d13de1489b6bf Kees Cook 2019-12-04 @215 if (WARN_ON_ONCE(bytes > INT_MAX))
6d13de1489b6bf Kees Cook 2019-12-04 216 return false;
b0377fedb65280 Al Viro 2017-06-29 217 check_object_size(addr, bytes, is_source);
b0377fedb65280 Al Viro 2017-06-29 218 return true;
b0377fedb65280 Al Viro 2017-06-29 219 }
b0377fedb65280 Al Viro 2017-06-29 220
:::::: The code at line 215 was first introduced by commit
:::::: 6d13de1489b6bf539695f96d945de3860e6d5e17 uaccess: disallow > INT_MAX copy sizes
:::::: TO: Kees Cook <keescook(a)chromium.org>
:::::: 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