From: kernel test robot <lkp@intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: kbuild-all@lists.01.org, Johannes Weiner <hannes@cmpxchg.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Andrew Morton <akpm@linux-foundation.org>,
Linux Memory Management List <linux-mm@kvack.org>
Subject: [hnaz-linux-mm:master 179/239] include/linux/thread_info.h:215:27: error: 'INT_MAX' undeclared
Date: Thu, 13 May 2021 17:36:14 +0800 [thread overview]
Message-ID: <202105131700.z2HuiNSx-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 4410 bytes --]
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/161b082aa6ac5047f1b0f243f0e834d2bfb39842
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@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@chromium.org>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.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: 10821 bytes --]
next reply other threads:[~2021-05-13 9:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-13 9:36 kernel test robot [this message]
2021-05-13 19:08 ` [hnaz-linux-mm:master 179/239] include/linux/thread_info.h:215:27: error: 'INT_MAX' undeclared Andrew Morton
2021-05-17 9:04 ` Andy Shevchenko
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=202105131700.z2HuiNSx-lkp@intel.com \
--to=lkp@intel.com \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bjorn.andersson@linaro.org \
--cc=hannes@cmpxchg.org \
--cc=kbuild-all@lists.01.org \
--cc=linux-mm@kvack.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;
as well as URLs for NNTP newsgroup(s).