From: kernel test robot <lkp@intel.com>
To: Kees Cook <keescook@chromium.org>,
Nick Desaulniers <ndesaulniers@google.com>
Cc: kbuild-all@lists.01.org, Kees Cook <keescook@chromium.org>,
linux-hardening@vger.kernel.org,
Nathan Chancellor <nathan@kernel.org>, Tom Rix <trix@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
Linux Memory Management List <linux-mm@kvack.org>,
Vlastimil Babka <vbabka@suse.cz>,
"Steven Rostedt (Google)" <rostedt@goodmis.org>,
David Gow <davidgow@google.com>,
Yury Norov <yury.norov@gmail.com>,
Masami Hiramatsu <mhiramat@kernel.org>,
Sander Vanheule <sander@svanheule.net>,
Peter Zijlstra <peterz@infradead.org>,
Josh Poimboeuf <jpoimboe@kernel.org>,
Dan Williams <dan.j.williams@intel.com>,
Isabella Basso <isabbasso@riseup.net>,
Eric Dumazet <edumazet@google.com>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Eric Biggers <ebiggers@google.com>,
Hannes Reinecke <hare@suse.de>,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev
Subject: Re: [PATCH v2 3/3] fortify: Use SIZE_MAX instead of (size_t)-1
Date: Sat, 3 Sep 2022 06:50:55 +0800 [thread overview]
Message-ID: <202209030625.wdoOhjAW-lkp@intel.com> (raw)
In-Reply-To: <20220902204351.2521805-4-keescook@chromium.org>
Hi Kees,
I love your patch! Yet something to improve:
[auto build test ERROR on akpm-mm/mm-everything]
[also build test ERROR on linus/master kees/for-next/pstore v6.0-rc3 next-20220901]
[cannot apply to kees/for-next/hardening]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Kees-Cook/Fix-FORTIFY-y-UBSAN_LOCAL_BOUNDS-y/20220903-044622
base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
config: powerpc-allyesconfig (https://download.01.org/0day-ci/archive/20220903/202209030625.wdoOhjAW-lkp@intel.com/config)
compiler: powerpc-linux-gcc (GCC) 12.1.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/intel-lab-lkp/linux/commit/6c991b3511a531e44e856fdf2b64020b70fd7b22
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Kees-Cook/Fix-FORTIFY-y-UBSAN_LOCAL_BOUNDS-y/20220903-044622
git checkout 6c991b3511a531e44e856fdf2b64020b70fd7b22
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=powerpc prepare
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
scripts/genksyms/parse.y: warning: 9 shift/reduce conflicts [-Wconflicts-sr]
scripts/genksyms/parse.y: warning: 5 reduce/reduce conflicts [-Wconflicts-rr]
scripts/genksyms/parse.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
In file included from include/linux/string.h:253,
from include/linux/uuid.h:12,
from include/linux/mod_devicetable.h:13,
from scripts/mod/devicetable-offsets.c:3:
include/linux/fortify-string.h: In function 'strcat':
>> include/linux/fortify-string.h:98:23: error: 'SIZE_MAX' undeclared (first use in this function)
98 | if (p_size == SIZE_MAX)
| ^~~~~~~~
include/linux/fortify-string.h:6:1: note: 'SIZE_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?
5 | #include <linux/const.h>
+++ |+#include <stdint.h>
6 |
include/linux/fortify-string.h:98:23: note: each undeclared identifier is reported only once for each function it appears in
98 | if (p_size == SIZE_MAX)
| ^~~~~~~~
include/linux/fortify-string.h: In function 'strnlen':
include/linux/fortify-string.h:20:24: error: 'SIZE_MAX' undeclared (first use in this function)
20 | size_t __ret = SIZE_MAX; \
| ^~~~~~~~
include/linux/fortify-string.h:109:24: note: in expansion of macro '__compiletime_strlen'
109 | size_t p_len = __compiletime_strlen(p);
| ^~~~~~~~~~~~~~~~~~~~
include/linux/fortify-string.h:20:24: note: 'SIZE_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?
20 | size_t __ret = SIZE_MAX; \
| ^~~~~~~~
include/linux/fortify-string.h:109:24: note: in expansion of macro '__compiletime_strlen'
109 | size_t p_len = __compiletime_strlen(p);
| ^~~~~~~~~~~~~~~~~~~~
include/linux/fortify-string.h: In function '__fortify_strlen':
include/linux/fortify-string.h:141:23: error: 'SIZE_MAX' undeclared (first use in this function)
141 | if (p_size == SIZE_MAX)
| ^~~~~~~~
include/linux/fortify-string.h:141:23: note: 'SIZE_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?
include/linux/fortify-string.h: In function 'strlcpy':
include/linux/fortify-string.h:158:23: error: 'SIZE_MAX' undeclared (first use in this function)
158 | if (p_size == SIZE_MAX && q_size == SIZE_MAX)
| ^~~~~~~~
include/linux/fortify-string.h:158:23: note: 'SIZE_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?
include/linux/fortify-string.h: In function 'strscpy':
include/linux/fortify-string.h:186:23: error: 'SIZE_MAX' undeclared (first use in this function)
186 | if (p_size == SIZE_MAX && q_size == SIZE_MAX)
| ^~~~~~~~
include/linux/fortify-string.h:186:23: note: 'SIZE_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?
include/linux/fortify-string.h: In function 'strncat':
include/linux/fortify-string.h:231:23: error: 'SIZE_MAX' undeclared (first use in this function)
231 | if (p_size == SIZE_MAX && q_size == SIZE_MAX)
| ^~~~~~~~
include/linux/fortify-string.h:231:23: note: 'SIZE_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?
include/linux/fortify-string.h: In function 'fortify_memset_chk':
include/linux/fortify-string.h:275:23: error: 'SIZE_MAX' undeclared (first use in this function)
275 | if (p_size != SIZE_MAX && p_size < size)
| ^~~~~~~~
include/linux/fortify-string.h:275:23: note: 'SIZE_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?
include/linux/fortify-string.h: In function 'fortify_memcpy_chk':
include/linux/fortify-string.h:369:24: error: 'SIZE_MAX' undeclared (first use in this function)
369 | if ((p_size != SIZE_MAX && p_size < size) ||
| ^~~~~~~~
include/linux/fortify-string.h:369:24: note: 'SIZE_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?
include/linux/fortify-string.h: In function 'strcpy':
include/linux/fortify-string.h:469:23: error: 'SIZE_MAX' undeclared (first use in this function)
469 | if (p_size == SIZE_MAX && q_size == SIZE_MAX)
| ^~~~~~~~
include/linux/fortify-string.h:469:23: note: 'SIZE_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?
make[2]: *** [scripts/Makefile.build:117: scripts/mod/devicetable-offsets.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [Makefile:1204: prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:222: __sub-make] Error 2
make: Target 'prepare' not remade because of errors.
vim +/SIZE_MAX +98 include/linux/fortify-string.h
92
93 __FORTIFY_INLINE __diagnose_as(__builtin_strcat, 1, 2)
94 char *strcat(char * const POS p, const char *q)
95 {
96 size_t p_size = __builtin_object_size(p, 1);
97
> 98 if (p_size == SIZE_MAX)
99 return __underlying_strcat(p, q);
100 if (strlcat(p, q, p_size) >= p_size)
101 fortify_panic(__func__);
102 return p;
103 }
104
--
0-DAY CI Kernel Test Service
https://01.org/lkp
parent reply other threads:[~2022-09-02 22:51 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20220902204351.2521805-4-keescook@chromium.org>]
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=202209030625.wdoOhjAW-lkp@intel.com \
--to=lkp@intel.com \
--cc=akpm@linux-foundation.org \
--cc=dan.j.williams@intel.com \
--cc=davidgow@google.com \
--cc=ebiggers@google.com \
--cc=edumazet@google.com \
--cc=hare@suse.de \
--cc=isabbasso@riseup.net \
--cc=jpoimboe@kernel.org \
--cc=kbuild-all@lists.01.org \
--cc=keescook@chromium.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux@rasmusvillemoes.dk \
--cc=llvm@lists.linux.dev \
--cc=mhiramat@kernel.org \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=sander@svanheule.net \
--cc=trix@redhat.com \
--cc=vbabka@suse.cz \
--cc=yury.norov@gmail.com \
/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