From: Marco Elver <elver@google.com>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>, Kees Cook <keescook@chromium.org>,
Dmitry Vyukov <dvyukov@google.com>,
Josh Poimboeuf <jpoimboe@kernel.org>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
Miroslav Benes <mbenes@suse.cz>,
kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org,
"Paul E. McKenney" <paulmck@kernel.org>
Subject: Re: [PATCH] kcsan: select CONFIG_CONSTRUCTORS
Date: Wed, 15 Feb 2023 10:25:44 +0100 [thread overview]
Message-ID: <CANpmjNNz+zuV5LpWj5sqeR1quK4GcumgQjjDbNx2m+jzeg_C7w@mail.gmail.com> (raw)
In-Reply-To: <20230215091503.1490152-1-arnd@kernel.org>
On Wed, 15 Feb 2023 at 10:15, Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> Building a kcsan enabled kernel for x86_64 with gcc-11 results in a lot
> of build warnings or errors without CONFIG_CONSTRUCTORS:
>
> x86_64-linux-ld: error: unplaced orphan section `.ctors.65436' from `arch/x86/lib/copy_mc.o'
> x86_64-linux-ld: error: unplaced orphan section `.ctors.65436' from `arch/x86/lib/cpu.o'
> x86_64-linux-ld: error: unplaced orphan section `.ctors.65436' from `arch/x86/lib/csum-partial_64.o'
> x86_64-linux-ld: error: unplaced orphan section `.ctors.65436' from `arch/x86/lib/csum-wrappers_64.o'
> x86_64-linux-ld: error: unplaced orphan section `.ctors.65436' from `arch/x86/lib/insn-eval.o'
> x86_64-linux-ld: error: unplaced orphan section `.ctors.65436' from `arch/x86/lib/insn.o'
> x86_64-linux-ld: error: unplaced orphan section `.ctors.65436' from `arch/x86/lib/misc.o'
>
> The same thing has been reported for mips64. I can't reproduce it for
> any other compiler version, so I don't know if constructors are always
> required here or if this is a gcc-11 specific implementation detail.
>
> I see no harm in always enabling constructors here, and this reliably
> fixes the build warnings for me.
>
> Link: https://lore.kernel.org/lkml/202204181801.r3MMkwJv-lkp@intel.com/T/
> Cc: Kees Cook <keescook@chromium.org>
> See-also: 3e6631485fae ("vmlinux.lds.h: Keep .ctors.* with .ctors")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Marco Elver <elver@google.com>
Looks like KASAN does select CONSTRUCTORS already, so KCSAN should as well.
Do you have a tree to take this through, or should it go through -rcu
as usual for KCSAN patches?
Thanks,
-- Marco
> ---
> lib/Kconfig.kcsan | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/lib/Kconfig.kcsan b/lib/Kconfig.kcsan
> index 4dedd61e5192..609ddfc73de5 100644
> --- a/lib/Kconfig.kcsan
> +++ b/lib/Kconfig.kcsan
> @@ -14,6 +14,7 @@ menuconfig KCSAN
> bool "KCSAN: dynamic data race detector"
> depends on HAVE_ARCH_KCSAN && HAVE_KCSAN_COMPILER
> depends on DEBUG_KERNEL && !KASAN
> + select CONSTRUCTORS
> select STACKTRACE
> help
> The Kernel Concurrency Sanitizer (KCSAN) is a dynamic
> --
> 2.39.1
>
next prev parent reply other threads:[~2023-02-15 9:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-15 9:14 [PATCH] kcsan: select CONFIG_CONSTRUCTORS Arnd Bergmann
2023-02-15 9:25 ` Marco Elver [this message]
2023-02-15 9:48 ` Arnd Bergmann
2023-02-15 22:42 ` Paul E. McKenney
2023-02-16 7:00 ` Marco Elver
2023-02-16 18:36 ` Paul E. McKenney
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=CANpmjNNz+zuV5LpWj5sqeR1quK4GcumgQjjDbNx2m+jzeg_C7w@mail.gmail.com \
--to=elver@google.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=dvyukov@google.com \
--cc=jpoimboe@kernel.org \
--cc=kasan-dev@googlegroups.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mbenes@suse.cz \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).