[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABCJKuednNrveGz6tQqHj7bbnVzLJFgCLt0CuZLT2KOvt8aNrg@mail.gmail.com>
Date: Wed, 19 Mar 2025 18:45:16 +0000
From: Sami Tolvanen <samitolvanen@...gle.com>
To: Ard Biesheuvel <ardb@...nel.org>
Cc: Aleksandr Nogikh <nogikh@...gle.com>, Masahiro Yamada <masahiroy@...nel.org>,
syzbot <syzbot+06fd1a3613c50d36129e@...kaller.appspotmail.com>, brgerst@...il.com,
linux-kernel@...r.kernel.org, linux-next@...r.kernel.org,
sfr@...b.auug.org.au, syzkaller-bugs@...glegroups.com,
Dmitry Vyukov <dvyukov@...gle.com>, Ingo Molnar <mingo@...nel.org>
Subject: Re: [syzbot] linux-next build error (20)
Hi Ard,
On Wed, Mar 19, 2025 at 8:38 AM Ard Biesheuvel <ardb@...nel.org> wrote:
>
> 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
The patch looks reasonable to me. Thanks for figuring this out!
Sami
Powered by blists - more mailing lists