* [hnaz-linux-mm:master 179/239] include/linux/thread_info.h:215:27: error: 'INT_MAX' undeclared
@ 2021-05-13 9:36 kernel test robot
2021-05-13 19:08 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2021-05-13 9:36 UTC (permalink / raw)
To: Andy Shevchenko
Cc: kbuild-all, Johannes Weiner, Bjorn Andersson, Andrew Morton,
Linux Memory Management List
[-- 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 --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [hnaz-linux-mm:master 179/239] include/linux/thread_info.h:215:27: error: 'INT_MAX' undeclared
2021-05-13 9:36 [hnaz-linux-mm:master 179/239] include/linux/thread_info.h:215:27: error: 'INT_MAX' undeclared kernel test robot
@ 2021-05-13 19:08 ` Andrew Morton
2021-05-17 9:04 ` Andy Shevchenko
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2021-05-13 19:08 UTC (permalink / raw)
To: kernel test robot
Cc: Andy Shevchenko, kbuild-all, Johannes Weiner, Bjorn Andersson,
Linux Memory Management List
On Thu, 13 May 2021 17:36:14 +0800 kernel test robot <lkp@intel.com> wrote:
> 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.
I'm surprised. I guess some later patch accidentally fixed it.
I expect we'll see a bunch more gramlins like this. And I assume this
fixes:
--- a/include/linux/thread_info.h~kernelh-split-out-panic-and-oops-helpers-fix
+++ a/include/linux/thread_info.h
@@ -9,6 +9,7 @@
#define _LINUX_THREAD_INFO_H
#include <linux/types.h>
+#include <linux/limits.h>
#include <linux/bug.h>
#include <linux/restart_block.h>
#include <linux/errno.h>
_
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [hnaz-linux-mm:master 179/239] include/linux/thread_info.h:215:27: error: 'INT_MAX' undeclared
2021-05-13 19:08 ` Andrew Morton
@ 2021-05-17 9:04 ` Andy Shevchenko
0 siblings, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2021-05-17 9:04 UTC (permalink / raw)
To: Andrew Morton
Cc: kernel test robot, kbuild-all, Johannes Weiner, Bjorn Andersson,
Linux Memory Management List
On Thu, May 13, 2021 at 12:08:05PM -0700, Andrew Morton wrote:
> On Thu, 13 May 2021 17:36:14 +0800 kernel test robot <lkp@intel.com> wrote:
>
> > 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.
>
> I'm surprised. I guess some later patch accidentally fixed it.
For the record I have tested on x86/64, so we may see a few more breakage
things, but I hope that the number will be quite small in comparison to the
initial attempt.
> I expect we'll see a bunch more gramlins like this. And I assume this
> fixes:
>
> --- a/include/linux/thread_info.h~kernelh-split-out-panic-and-oops-helpers-fix
> +++ a/include/linux/thread_info.h
> @@ -9,6 +9,7 @@
> #define _LINUX_THREAD_INFO_H
>
> #include <linux/types.h>
> +#include <linux/limits.h>
> #include <linux/bug.h>
> #include <linux/restart_block.h>
> #include <linux/errno.h>
> _
LGTM, thanks!
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-05-17 9:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-13 9:36 [hnaz-linux-mm:master 179/239] include/linux/thread_info.h:215:27: error: 'INT_MAX' undeclared kernel test robot
2021-05-13 19:08 ` Andrew Morton
2021-05-17 9:04 ` Andy Shevchenko
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).