* Re: [PATCH 6/9] fortify: Split reporting and avoid passing string pointer
[not found] <20230406000212.3442647-6-keescook@chromium.org>
@ 2023-04-06 11:19 ` kernel test robot
2024-02-22 13:00 ` Arnd Bergmann
2023-04-07 10:26 ` kernel test robot
1 sibling, 1 reply; 5+ messages in thread
From: kernel test robot @ 2023-04-06 11:19 UTC (permalink / raw)
To: Kees Cook, linux-hardening
Cc: llvm, oe-kbuild-all, Kees Cook, Andy Shevchenko, Cezary Rojewski,
Puyou Lu, Mark Brown, Josh Poimboeuf, Peter Zijlstra,
Brendan Higgins, David Gow, Andrew Morton,
Linux Memory Management List, Nathan Chancellor,
Alexander Potapenko, Zhaoyang Huang, Randy Dunlap,
Geert Uytterhoeven, Miguel Ojeda, Nick Desaulniers, Liam Howlett,
Vlastimil Babka, Dan Williams, Rasmus Villemoes, Yury Norov,
Jason A. Donenfeld, Sander Vanheule, Eric Biggers,
Masami Hiramatsu (Google),
Andrey Konovalov, Linus Walleij
Hi Kees,
kernel test robot noticed the following build errors:
[auto build test ERROR on kees/for-next/hardening]
[also build test ERROR on kees/for-next/pstore kees/for-next/kspp akpm-mm/mm-everything linus/master v6.3-rc5 next-20230406]
[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/kunit-tool-Enable-CONFIG_FORTIFY_SOURCE-under-UML/20230406-081014
base: https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening
patch link: https://lore.kernel.org/r/20230406000212.3442647-6-keescook%40chromium.org
patch subject: [PATCH 6/9] fortify: Split reporting and avoid passing string pointer
config: arm-randconfig-r025-20230403 (https://download.01.org/0day-ci/archive/20230406/202304061930.4Au0PASm-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project 67409911353323ca5edf2049ef0df54132fa1ca7)
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
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://github.com/intel-lab-lkp/linux/commit/4fd520e6ee549e1ffe8859e26e57ea64b48e78ea
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Kees-Cook/kunit-tool-Enable-CONFIG_FORTIFY_SOURCE-under-UML/20230406-081014
git checkout 4fd520e6ee549e1ffe8859e26e57ea64b48e78ea
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202304061930.4Au0PASm-lkp@intel.com/
All errors (new ones prefixed by >>):
>> ld.lld: error: undefined symbol: __fortify_panic
>>> referenced by fortify-string.h:208 (include/linux/fortify-string.h:208)
>>> arch/arm/boot/compressed/fdt_ro.o:(fdt_stringlist_count)
>>> referenced by fortify-string.h:208 (include/linux/fortify-string.h:208)
>>> arch/arm/boot/compressed/fdt_ro.o:(fdt_stringlist_search)
>>> referenced by fortify-string.h:208 (include/linux/fortify-string.h:208)
>>> arch/arm/boot/compressed/fdt_ro.o:(fdt_stringlist_get)
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 6/9] fortify: Split reporting and avoid passing string pointer
[not found] <20230406000212.3442647-6-keescook@chromium.org>
2023-04-06 11:19 ` [PATCH 6/9] fortify: Split reporting and avoid passing string pointer kernel test robot
@ 2023-04-07 10:26 ` kernel test robot
1 sibling, 0 replies; 5+ messages in thread
From: kernel test robot @ 2023-04-07 10:26 UTC (permalink / raw)
To: Kees Cook, linux-hardening
Cc: oe-kbuild-all, Kees Cook, Andy Shevchenko, Cezary Rojewski,
Puyou Lu, Mark Brown, Josh Poimboeuf, Peter Zijlstra,
Brendan Higgins, David Gow, Andrew Morton,
Linux Memory Management List, Nathan Chancellor,
Alexander Potapenko, Zhaoyang Huang, Randy Dunlap,
Geert Uytterhoeven, Miguel Ojeda, Nick Desaulniers, Liam Howlett,
Vlastimil Babka, Dan Williams, Rasmus Villemoes, Yury Norov,
Jason A. Donenfeld, Sander Vanheule, Eric Biggers,
Masami Hiramatsu (Google),
Andrey Konovalov, Linus Walleij
Hi Kees,
kernel test robot noticed the following build warnings:
[auto build test WARNING on kees/for-next/hardening]
[also build test WARNING on kees/for-next/pstore kees/for-next/kspp akpm-mm/mm-everything linus/master v6.3-rc5 next-20230406]
[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/kunit-tool-Enable-CONFIG_FORTIFY_SOURCE-under-UML/20230406-081014
base: https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening
patch link: https://lore.kernel.org/r/20230406000212.3442647-6-keescook%40chromium.org
patch subject: [PATCH 6/9] fortify: Split reporting and avoid passing string pointer
config: arm64-randconfig-s053-20230406 (https://download.01.org/0day-ci/archive/20230407/202304071824.648116sH-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 12.1.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-39-gce1a6720-dirty
# https://github.com/intel-lab-lkp/linux/commit/4fd520e6ee549e1ffe8859e26e57ea64b48e78ea
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Kees-Cook/kunit-tool-Enable-CONFIG_FORTIFY_SOURCE-under-UML/20230406-081014
git checkout 4fd520e6ee549e1ffe8859e26e57ea64b48e78ea
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202304071824.648116sH-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
lib/string_helpers.c:1030:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_strncpy'
lib/string_helpers.c:1033:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_strnlen'
lib/string_helpers.c:1036:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_strlen'
lib/string_helpers.c:1039:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_strlcpy'
lib/string_helpers.c:1042:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_strscpy'
lib/string_helpers.c:1045:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_strlcat'
lib/string_helpers.c:1048:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_strcat'
lib/string_helpers.c:1051:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_strncat'
lib/string_helpers.c:1054:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_memset'
lib/string_helpers.c:1057:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_memcpy'
lib/string_helpers.c:1060:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_memmove'
lib/string_helpers.c:1063:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_memscan'
lib/string_helpers.c:1066:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_memcmp'
lib/string_helpers.c:1069:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_memchr'
lib/string_helpers.c:1072:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_memchr_inv'
lib/string_helpers.c:1075:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_kmemdup'
lib/string_helpers.c:1078:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_strcpy'
>> lib/string_helpers.c:1030:14: sparse: sparse: incompatible types for 'case' statement
lib/string_helpers.c:1033:14: sparse: sparse: incompatible types for 'case' statement
lib/string_helpers.c:1036:14: sparse: sparse: incompatible types for 'case' statement
lib/string_helpers.c:1039:14: sparse: sparse: incompatible types for 'case' statement
lib/string_helpers.c:1042:14: sparse: sparse: incompatible types for 'case' statement
lib/string_helpers.c:1045:14: sparse: sparse: incompatible types for 'case' statement
lib/string_helpers.c:1048:14: sparse: sparse: incompatible types for 'case' statement
lib/string_helpers.c:1051:14: sparse: sparse: incompatible types for 'case' statement
lib/string_helpers.c:1054:14: sparse: sparse: incompatible types for 'case' statement
lib/string_helpers.c:1057:14: sparse: sparse: incompatible types for 'case' statement
lib/string_helpers.c:1060:14: sparse: sparse: incompatible types for 'case' statement
lib/string_helpers.c:1063:14: sparse: sparse: incompatible types for 'case' statement
lib/string_helpers.c:1066:14: sparse: sparse: incompatible types for 'case' statement
lib/string_helpers.c:1069:14: sparse: sparse: incompatible types for 'case' statement
lib/string_helpers.c:1072:14: sparse: sparse: incompatible types for 'case' statement
lib/string_helpers.c:1075:14: sparse: sparse: incompatible types for 'case' statement
lib/string_helpers.c:1078:14: sparse: sparse: incompatible types for 'case' statement
lib/string_helpers.c:1030:14: sparse: sparse: Expected constant expression in case statement
lib/string_helpers.c:1033:14: sparse: sparse: Expected constant expression in case statement
lib/string_helpers.c:1036:14: sparse: sparse: Expected constant expression in case statement
lib/string_helpers.c:1039:14: sparse: sparse: Expected constant expression in case statement
lib/string_helpers.c:1042:14: sparse: sparse: Expected constant expression in case statement
lib/string_helpers.c:1045:14: sparse: sparse: Expected constant expression in case statement
lib/string_helpers.c:1048:14: sparse: sparse: Expected constant expression in case statement
lib/string_helpers.c:1051:14: sparse: sparse: Expected constant expression in case statement
lib/string_helpers.c:1054:14: sparse: sparse: Expected constant expression in case statement
lib/string_helpers.c:1057:14: sparse: sparse: Expected constant expression in case statement
lib/string_helpers.c:1060:14: sparse: sparse: Expected constant expression in case statement
lib/string_helpers.c:1063:14: sparse: sparse: Expected constant expression in case statement
lib/string_helpers.c:1066:14: sparse: sparse: Expected constant expression in case statement
lib/string_helpers.c:1069:14: sparse: sparse: Expected constant expression in case statement
lib/string_helpers.c:1072:14: sparse: sparse: Expected constant expression in case statement
lib/string_helpers.c:1075:14: sparse: sparse: Expected constant expression in case statement
lib/string_helpers.c:1078:14: sparse: sparse: Expected constant expression in case statement
vim +/case +1030 lib/string_helpers.c
1023
1024 void __fortify_report(u8 reason)
1025 {
1026 const char *name;
1027 const bool write = !!(reason & 0x1);
1028
1029 switch (reason >> 1) {
> 1030 case FORTIFY_FUNC_strncpy:
1031 name = "strncpy";
1032 break;
1033 case FORTIFY_FUNC_strnlen:
1034 name = "strnlen";
1035 break;
1036 case FORTIFY_FUNC_strlen:
1037 name = "strlen";
1038 break;
1039 case FORTIFY_FUNC_strlcpy:
1040 name = "strlcpy";
1041 break;
1042 case FORTIFY_FUNC_strscpy:
1043 name = "strscpy";
1044 break;
1045 case FORTIFY_FUNC_strlcat:
1046 name = "strlcat";
1047 break;
1048 case FORTIFY_FUNC_strcat:
1049 name = "strcat";
1050 break;
1051 case FORTIFY_FUNC_strncat:
1052 name = "strncat";
1053 break;
> 1054 case FORTIFY_FUNC_memset:
1055 name = "memset";
1056 break;
1057 case FORTIFY_FUNC_memcpy:
1058 name = "memcpy";
1059 break;
1060 case FORTIFY_FUNC_memmove:
1061 name = "memmove";
1062 break;
1063 case FORTIFY_FUNC_memscan:
1064 name = "memscan";
1065 break;
1066 case FORTIFY_FUNC_memcmp:
1067 name = "memcmp";
1068 break;
1069 case FORTIFY_FUNC_memchr:
1070 name = "memchr";
1071 break;
1072 case FORTIFY_FUNC_memchr_inv:
1073 name = "memchr_inv";
1074 break;
1075 case FORTIFY_FUNC_kmemdup:
1076 name = "kmemdup";
1077 break;
1078 case FORTIFY_FUNC_strcpy:
1079 name = "strcpy";
1080 break;
1081 default:
1082 name = "unknown";
1083 }
1084 WARN(1, "%s: detected buffer %s overflow\n", name, write ? "write" : "read");
1085 }
1086 EXPORT_SYMBOL(__fortify_report);
1087
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 6/9] fortify: Split reporting and avoid passing string pointer
2023-04-06 11:19 ` [PATCH 6/9] fortify: Split reporting and avoid passing string pointer kernel test robot
@ 2024-02-22 13:00 ` Arnd Bergmann
2024-02-22 16:30 ` Kees Cook
0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2024-02-22 13:00 UTC (permalink / raw)
To: kernel test robot, Kees Cook, linux-hardening
Cc: llvm, oe-kbuild-all, Andy Shevchenko, Cezary Rojewski, Puyou Lu,
Mark Brown, Josh Poimboeuf, Peter Zijlstra, Brendan Higgins,
David Gow, Andrew Morton, Linux Memory Management List,
Nathan Chancellor, Alexander Potapenko, Zhaoyang Huang,
Randy Dunlap, Geert Uytterhoeven, Miguel Ojeda, Nick Desaulniers,
Liam R. Howlett, Vlastimil Babka, Dan Williams, Rasmus Villemoes,
Yury Norov, Jason A . Donenfeld, Sander Vanheule, Eric Biggers,
Masami Hiramatsu, Andrey Konovalov, Linus Walleij
On Thu, Apr 6, 2023, at 13:19, kernel test robot wrote:
> If you fix the issue, kindly add following tag where applicable
> | Reported-by: kernel test robot <lkp@intel.com>
> | Link:
> https://lore.kernel.org/oe-kbuild-all/202304061930.4Au0PASm-lkp@intel.com/
>
> All errors (new ones prefixed by >>):
>
>>> ld.lld: error: undefined symbol: __fortify_panic
> >>> referenced by fortify-string.h:208 (include/linux/fortify-string.h:208)
> >>> arch/arm/boot/compressed/fdt_ro.o:(fdt_stringlist_count)
> >>> referenced by fortify-string.h:208 (include/linux/fortify-string.h:208)
> >>> arch/arm/boot/compressed/fdt_ro.o:(fdt_stringlist_search)
> >>> referenced by fortify-string.h:208 (include/linux/fortify-string.h:208)
> >>> arch/arm/boot/compressed/fdt_ro.o:(fdt_stringlist_get)
I get a related build failure from the same commit:
arch/arm/boot/compressed/misc.c:157:6: error: no previous prototype for '__fortify_panic' [-Werror=missing-prototypes]
157 | void __fortify_panic(const u8 reason, size_t avail, size_t size)
Arnd
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 6/9] fortify: Split reporting and avoid passing string pointer
2024-02-22 13:00 ` Arnd Bergmann
@ 2024-02-22 16:30 ` Kees Cook
2024-02-22 17:11 ` Andy Shevchenko
0 siblings, 1 reply; 5+ messages in thread
From: Kees Cook @ 2024-02-22 16:30 UTC (permalink / raw)
To: Arnd Bergmann
Cc: kernel test robot, linux-hardening, llvm, oe-kbuild-all,
Andy Shevchenko, Cezary Rojewski, Puyou Lu, Mark Brown,
Josh Poimboeuf, Peter Zijlstra, Brendan Higgins, David Gow,
Andrew Morton, Linux Memory Management List, Nathan Chancellor,
Alexander Potapenko, Zhaoyang Huang, Randy Dunlap,
Geert Uytterhoeven, Miguel Ojeda, Nick Desaulniers,
Liam R. Howlett, Vlastimil Babka, Dan Williams, Rasmus Villemoes,
Yury Norov, Jason A . Donenfeld, Sander Vanheule, Eric Biggers,
Masami Hiramatsu, Andrey Konovalov, Linus Walleij
On Thu, Feb 22, 2024 at 02:00:26PM +0100, Arnd Bergmann wrote:
> On Thu, Apr 6, 2023, at 13:19, kernel test robot wrote:
>
> > If you fix the issue, kindly add following tag where applicable
> > | Reported-by: kernel test robot <lkp@intel.com>
> > | Link:
> > https://lore.kernel.org/oe-kbuild-all/202304061930.4Au0PASm-lkp@intel.com/
> >
> > All errors (new ones prefixed by >>):
> >
> >>> ld.lld: error: undefined symbol: __fortify_panic
> > >>> referenced by fortify-string.h:208 (include/linux/fortify-string.h:208)
> > >>> arch/arm/boot/compressed/fdt_ro.o:(fdt_stringlist_count)
> > >>> referenced by fortify-string.h:208 (include/linux/fortify-string.h:208)
> > >>> arch/arm/boot/compressed/fdt_ro.o:(fdt_stringlist_search)
> > >>> referenced by fortify-string.h:208 (include/linux/fortify-string.h:208)
> > >>> arch/arm/boot/compressed/fdt_ro.o:(fdt_stringlist_get)
>
> I get a related build failure from the same commit:
>
> arch/arm/boot/compressed/misc.c:157:6: error: no previous prototype for '__fortify_panic' [-Werror=missing-prototypes]
> 157 | void __fortify_panic(const u8 reason, size_t avail, size_t size)
Whoops, thank you! This series got a refresh after you did the
missing-prototypes work and I missed this one. I've fixed it and
double-checked for any others. Hopefully this will be clean in the next
-next. :)
-Kees
--
Kees Cook
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 6/9] fortify: Split reporting and avoid passing string pointer
2024-02-22 16:30 ` Kees Cook
@ 2024-02-22 17:11 ` Andy Shevchenko
0 siblings, 0 replies; 5+ messages in thread
From: Andy Shevchenko @ 2024-02-22 17:11 UTC (permalink / raw)
To: Kees Cook
Cc: Arnd Bergmann, kernel test robot, linux-hardening, llvm,
oe-kbuild-all, Andy Shevchenko, Cezary Rojewski, Puyou Lu,
Mark Brown, Josh Poimboeuf, Peter Zijlstra, Brendan Higgins,
David Gow, Andrew Morton, Linux Memory Management List,
Nathan Chancellor, Alexander Potapenko, Zhaoyang Huang,
Randy Dunlap, Geert Uytterhoeven, Miguel Ojeda, Nick Desaulniers,
Liam R. Howlett, Vlastimil Babka, Dan Williams, Rasmus Villemoes,
Yury Norov, Jason A . Donenfeld, Sander Vanheule, Eric Biggers,
Masami Hiramatsu, Andrey Konovalov, Linus Walleij
On Thu, Feb 22, 2024 at 6:30 PM Kees Cook <keescook@chromium.org> wrote:
> On Thu, Feb 22, 2024 at 02:00:26PM +0100, Arnd Bergmann wrote:
> > On Thu, Apr 6, 2023, at 13:19, kernel test robot wrote:
> >
> > > If you fix the issue, kindly add following tag where applicable
> > > | Reported-by: kernel test robot <lkp@intel.com>
> > > | Link:
> > > https://lore.kernel.org/oe-kbuild-all/202304061930.4Au0PASm-lkp@intel.com/
> > >
> > > All errors (new ones prefixed by >>):
> > >
> > >>> ld.lld: error: undefined symbol: __fortify_panic
> > > >>> referenced by fortify-string.h:208 (include/linux/fortify-string.h:208)
> > > >>> arch/arm/boot/compressed/fdt_ro.o:(fdt_stringlist_count)
> > > >>> referenced by fortify-string.h:208 (include/linux/fortify-string.h:208)
> > > >>> arch/arm/boot/compressed/fdt_ro.o:(fdt_stringlist_search)
> > > >>> referenced by fortify-string.h:208 (include/linux/fortify-string.h:208)
> > > >>> arch/arm/boot/compressed/fdt_ro.o:(fdt_stringlist_get)
> >
> > I get a related build failure from the same commit:
> >
> > arch/arm/boot/compressed/misc.c:157:6: error: no previous prototype for '__fortify_panic' [-Werror=missing-prototypes]
> > 157 | void __fortify_panic(const u8 reason, size_t avail, size_t size)
>
> Whoops, thank you! This series got a refresh after you did the
> missing-prototypes work and I missed this one. I've fixed it and
> double-checked for any others. Hopefully this will be clean in the next
> -next. :)
Thank you! (FWIW, I also hit it today)
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-02-22 17:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20230406000212.3442647-6-keescook@chromium.org>
2023-04-06 11:19 ` [PATCH 6/9] fortify: Split reporting and avoid passing string pointer kernel test robot
2024-02-22 13:00 ` Arnd Bergmann
2024-02-22 16:30 ` Kees Cook
2024-02-22 17:11 ` Andy Shevchenko
2023-04-07 10:26 ` kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox