[syzbot] linux-next build error (20)

9 views
Skip to first unread message

syzbot

unread,
Feb 23, 2025, 6:02:26 AMFeb 23
to linux-...@vger.kernel.org, linux...@vger.kernel.org, s...@canb.auug.org.au, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: d4b0fd87ff0d Add linux-next specific files for 20250221
git tree: linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=17a5bae4580000
kernel config: https://syzkaller.appspot.com/x/.config?x=76d7299d72819017
dashboard link: https://syzkaller.appspot.com/bug?extid=06fd1a3613c50d36129e
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+06fd1a...@syzkaller.appspotmail.com

<stdin>:4:15: error: use of undeclared identifier '__ref_stack_chk_guard'

---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

Aleksandr Nogikh

unread,
Mar 19, 2025, 5:10:57 AMMar 19
to syzbot, brg...@gmail.com, linux-...@vger.kernel.org, linux...@vger.kernel.org, s...@canb.auug.org.au, syzkall...@googlegroups.com, Dmitry Vyukov, ar...@kernel.org
On Sat, Feb 22, 2025 at 10:02 PM syzbot
<syzbot+06fd1a...@syzkaller.appspotmail.com> wrote:
>
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: d4b0fd87ff0d Add linux-next specific files for 20250221
> git tree: linux-next
> console output: https://syzkaller.appspot.com/x/log.txt?x=17a5bae4580000
> kernel config: https://syzkaller.appspot.com/x/.config?x=76d7299d72819017
> dashboard link: https://syzkaller.appspot.com/bug?extid=06fd1a3613c50d36129e
> compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+06fd1a...@syzkaller.appspotmail.com
>
> <stdin>:4:15: error: use of undeclared identifier '__ref_stack_chk_guard'

Manual bisection pointed to the commits from this patch series:

[PATCH v5 00/16] x86-64: Stack protector and percpu improvements
https://lore.kernel.org/lkml/20241105155801.1...@gmail.com/

Brian, could you please take a look at this syzbot report?

The latest build log (for next-20250318) is here:
https://syzkaller.appspot.com/text?tag=CrashLog&x=10a745e4580000

It failed with the following error:

<stdin>:4:15: error: use of undeclared identifier '__ref_stack_chk_guard'
EXPORT_SYMBOL(__ref_stack_chk_guard);
^
1 error generated.
make[4]: *** [scripts/Makefile.build:335: arch/x86/entry/entry.o] Error 1
make[4]: *** Deleting file 'arch/x86/entry/entry.o'
make[4]: *** Waiting for unfinished jobs....

--
Aleksandr


>
> ---
> This report is generated by a bot. It may contain errors.
> See https://goo.gl/tpsmEJ for more information about syzbot.
> syzbot engineers can be reached at syzk...@googlegroups.com.
>
> syzbot will keep track of this issue. See:
> https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
>
> If the report is already addressed, let syzbot know by replying with:
> #syz fix: exact-commit-title
>
> If you want to overwrite report's subsystems, reply with:
> #syz set subsystems: new-subsystem
> (See the list of subsystem names on the web dashboard)
>
> If the report is a duplicate of another one, reply with:
> #syz dup: exact-subject-of-another-report
>
> If you want to undo deduplication, reply with:
> #syz undup
>
> --
> You received this message because you are subscribed to the Google Groups "syzkaller-bugs" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller-bug...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/syzkaller-bugs/67bab9f0.050a0220.bbfd1.000e.GAE%40google.com.

Ard Biesheuvel

unread,
Mar 19, 2025, 8:38:33 AMMar 19
to Aleksandr Nogikh, Sami Tolvanen, Masahiro Yamada, syzbot, brg...@gmail.com, linux-...@vger.kernel.org, linux...@vger.kernel.org, s...@canb.auug.org.au, syzkall...@googlegroups.com, Dmitry Vyukov, Ingo Molnar
(cc Sami, Masahiro)
This appears to be an interaction with gendwarfksyms:

# AS arch/x86/entry/entry.o
clang-15 -Wp,-MMD,arch/x86/entry/.entry.o.d -nostdinc
-I/usr/local/google/home/ardb/linux/arch/x86/include
-I./arch/x86/include/generated
-I/usr/local/google/home/ardb/linux/include -I./include
-I/usr/local/google/home/ardb/linux/arch/x86/include/uapi
-I./arch/x86/include/generated/uapi
-I/usr/local/google/home/ardb/linux/include/uapi
-I./include/generated/uapi -include
/usr/local/google/home/ardb/linux/include/linux/compiler-version.h
-include /usr/local/google/home/ardb/linux/include/linux/kconfig.h
-D__KERNEL__ --target=x86_64-linux-gnu -fintegrated-as
-Werror=unknown-warning-option -Werror=ignored-optimization-argument
-Werror=option-ignored -Werror=unused-command-line-argument
-fmacro-prefix-map=/usr/local/google/home/ardb/linux/= -D__ASSEMBLY__
-fno-PIE -m64 -g -gdwarf-4
-I/usr/local/google/home/ardb/linux/arch/x86/entry -Iarch/x86/entry
-DKBUILD_MODFILE='"arch/x86/entry/entry"' -DKBUILD_MODNAME='"entry"'
-D__KBUILD_MODNAME=kmod_entry -c -o arch/x86/entry/entry.o
/usr/local/google/home/ardb/linux/arch/x86/entry/entry.S
# cmd_gen_symversions_S arch/x86/entry/entry.o
if llvm-nm-15 arch/x86/entry/entry.o 2>/dev/null | grep -q '
__export_symbol_'; then { echo "#include <linux/kernel.h>" ; echo
"#include <linux/string.h>" ; echo "#include <asm/asm-prototypes.h>" ;
llvm-nm-15 arch/x86/entry/entry.o | sed -n 's/.*
__export_symbol_\(.*\)/EXPORT_SYMBOL(\1);/p' ; } | clang-15 ... -c -o
arch/x86/entry/entry.gendwarfksyms.o -xc -; llvm-nm-15
arch/x86/entry/entry.o | sed -n 's/.* __export_symbol_\(.*\)/\1/p' |
./scripts/gendwarfksyms/gendwarfksyms
arch/x86/entry/entry.gendwarfksyms.o >> arch/x86/entry/.entry.o.cmd;
fi
<stdin>:4:15: error: use of undeclared identifier '__ref_stack_chk_guard'
EXPORT_SYMBOL(__ref_stack_chk_guard);
^
1 error generated.

The issue here is that we deliberately hide __ref_stack_chk_guard from
the compiler, because Clang will otherwise generate incorrect code.
[0]

I managed to work around this issue using the hack below, but I'm not
too familiar with the gendwarfksyms code, so I'll leave it up to Sami
and Masahiro to decide whether this is the right approach before
sending out a patch.


--- a/arch/x86/include/asm/asm-prototypes.h
+++ b/arch/x86/include/asm/asm-prototypes.h
@@ -20,6 +20,7 @@
extern void cmpxchg8b_emu(void);
#endif

-#if defined(__GENKSYMS__) && defined(CONFIG_STACKPROTECTOR)
+#if (defined(__GENKSYMS__) || defined(__GENDWARFKSYMS__)) \
+ && defined(CONFIG_STACKPROTECTOR)
extern unsigned long __ref_stack_chk_guard;
#endif

--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -311,7 +311,8 @@
ifdef CONFIG_GENDWARFKSYMS
cmd_gensymtypes_S = \
$(getasmexports) | \
- $(CC) $(c_flags) -c -o $(@:.o=.gendwarfksyms.o) -xc -; \
+ $(CC) -D__GENDWARFKSYMS__ \
+ $(c_flags) -c -o $(@:.o=.gendwarfksyms.o) -xc -; \
$(call getexportsymbols,\1) | \
$(gendwarfksyms) $(@:.o=.gendwarfksyms.o)
else

(Note that simply #define'ing __GENKSYMS__ here and relying on that in
asm-prototypes.h doesn't work.)


[0] 577c134d311b ("x86/stackprotector: Work around strict Clang TLS
symbol requirements")

Sami Tolvanen

unread,
Mar 19, 2025, 6:45:57 PMMar 19
to Ard Biesheuvel, Aleksandr Nogikh, Masahiro Yamada, syzbot, brg...@gmail.com, linux-...@vger.kernel.org, linux...@vger.kernel.org, s...@canb.auug.org.au, syzkall...@googlegroups.com, Dmitry Vyukov, Ingo Molnar
Hi Ard,
The patch looks reasonable to me. Thanks for figuring this out!

Sami

syzbot

unread,
Mar 20, 2025, 8:01:47 AMMar 20
to linux-...@vger.kernel.org, syzkall...@googlegroups.com
For archival purposes, forwarding an incoming command email to
linux-...@vger.kernel.org, syzkall...@googlegroups.com.

***

Subject: Re: [syzbot] linux-next build error (20)
Author: ar...@kernel.org

#syz test

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 993708d11874..7855cdc4e763 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -305,6 +305,7 @@ $(obj)/%.rs: $(obj)/%.rs.S FORCE
getasmexports =
\
{ echo "\#include <linux/kernel.h>" ; \
echo "\#include <linux/string.h>" ; \
+ echo "\#define __GENKSYMS__" ; \
echo "\#include <asm/asm-prototypes.h>" ; \
$(call getexportsymbols,EXPORT_SYMBOL(\1);) ; }

syzbot

unread,
Mar 20, 2025, 8:19:09 AMMar 20
to ar...@kernel.org, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-by: syzbot+06fd1a...@syzkaller.appspotmail.com
Tested-by: syzbot+06fd1a...@syzkaller.appspotmail.com

Tested on:

commit: ff7f9b19 Add linux-next specific files for 20250319
git tree: linux-next
kernel config: https://syzkaller.appspot.com/x/.config?x=4bdd42b70d1ca0a
dashboard link: https://syzkaller.appspot.com/bug?extid=06fd1a3613c50d36129e
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=174fe004580000

Note: testing is done by a robot and is best-effort only.

syzbot

unread,
Apr 14, 2025, 2:48:32 PM (11 days ago) Apr 14
to linux-...@vger.kernel.org, syzkall...@googlegroups.com
For archival purposes, forwarding an incoming command email to
linux-...@vger.kernel.org, syzkall...@googlegroups.com.

***

Subject:
Author: nog...@google.com

The bug was fixed with a different commit than the recorded [PATCH] discussion.
Close it so that it may be reopened the next time we face a linux next
build problem.

#syz invalid
Reply all
Reply to author
Forward
0 new messages