lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 15 Feb 2023 10:25:44 +0100
From:   Marco Elver <elver@...gle.com>
To:     Arnd Bergmann <arnd@...nel.org>
Cc:     Arnd Bergmann <arnd@...db.de>, Kees Cook <keescook@...omium.org>,
        Dmitry Vyukov <dvyukov@...gle.com>,
        Josh Poimboeuf <jpoimboe@...nel.org>,
        "Peter Zijlstra (Intel)" <peterz@...radead.org>,
        Miroslav Benes <mbenes@...e.cz>, kasan-dev@...glegroups.com,
        linux-kernel@...r.kernel.org,
        "Paul E. McKenney" <paulmck@...nel.org>
Subject: Re: [PATCH] kcsan: select CONFIG_CONSTRUCTORS

On Wed, 15 Feb 2023 at 10:15, Arnd Bergmann <arnd@...nel.org> wrote:
>
> From: Arnd Bergmann <arnd@...db.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@...omium.org>
> See-also: 3e6631485fae ("vmlinux.lds.h: Keep .ctors.* with .ctors")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>

Reviewed-by: Marco Elver <elver@...gle.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
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ