Re: [PROBLEM] randconfig: ./include/linux/fortify-string.h:122:33: error: ‘__builtin_strcpy’ source argument is the same as destination [-Werror=restrict]
From: Kees Cook
Date: Thu Jun 27 2024 - 14:28:26 EST
On Thu, Jun 27, 2024 at 08:25:01PM +0200, Mirsad Todorovac wrote:
> Hi all,
>
> I hope it will catch your attention, for I couldn't sort out what is wrong with this:
>
> KCONFIG_SEED=0xD859674
>
> on vanilla torvalds tree, commit v6.10-rc4-366-gafcd48134c58
>
> _______________________________________________________________
> $ time nice make -j 36 bindeb-pkg |& tee ../err-6.10-rc5-08.log; date
> GEN debian
> dpkg-buildpackage --build=binary --no-pre-clean --unsigned-changes -R'make -f debian/rules' -j1 -a$(cat debian/arch)
> dpkg-buildpackage: info: source package linux-upstream
> dpkg-buildpackage: info: source version 6.10.0-rc5-gafcd48134c58-34
> dpkg-buildpackage: info: source distribution jammy
> dpkg-buildpackage: info: source changed by marvin <marvin@defiant>
> dpkg-architecture: warning: specified GNU system type i686-linux-gnu does not match CC system type x86_64-linux-gnu, try setting a correct CC environment variable
> dpkg-source --before-build .
> dpkg-buildpackage: info: host architecture i386
> make -f debian/rules binary
> #
> # No change to .config
> #
> CALL scripts/checksyscalls.sh
> UPD init/utsversion-tmp.h
> CC init/version.o
> AR init/built-in.a
> CC kernel/kallsyms.o
> In file included from ./include/linux/string.h:374,
> from ./arch/x86/include/asm/page_32.h:18,
> from ./arch/x86/include/asm/page.h:14,
> from ./arch/x86/include/asm/thread_info.h:12,
> from ./include/linux/thread_info.h:60,
> from ./include/linux/spinlock.h:60,
> from ./include/linux/mmzone.h:8,
> from ./include/linux/gfp.h:7,
> from ./include/linux/mm.h:7,
> from ./include/linux/kallsyms.h:13,
> from kernel/kallsyms.c:15:
> kernel/kallsyms.c: In function ‘__sprint_symbol’:
> ./include/linux/fortify-string.h:122:33: error: ‘__builtin_strcpy’ source argument is the same as destination [-Werror=restrict]
> 122 | #define __underlying_strcpy __builtin_strcpy
> | ^
> ./include/linux/fortify-string.h:787:24: note: in expansion of macro ‘__underlying_strcpy’
> 787 | return __underlying_strcpy(p, q);
> | ^~~~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> make[6]: *** [scripts/Makefile.build:244: kernel/kallsyms.o] Error 1
> make[5]: *** [scripts/Makefile.build:485: kernel] Error 2
> make[4]: *** [Makefile:1934: .] Error 2
> make[3]: *** [debian/rules:74: build-arch] Error 2
> dpkg-buildpackage: error: make -f debian/rules binary subprocess returned exit status 2
> make[2]: *** [scripts/Makefile.package:121: bindeb-pkg] Error 2
> make[1]: *** [/home/marvin/linux/kernel/linux_torvalds/Makefile:1555: bindeb-pkg] Error 2
> make: *** [Makefile:240: __sub-make] Error 2
Does this patch solve the problem for you?
https://lore.kernel.org/lkml/20240604044228.2910712-1-liujinlong@xxxxxxxxxx/
-Kees
--
Kees Cook