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]
Message-ID: <CAKwvOdkKsoYw9KOfwdHYg7OkTz0TQ6YgZZcqQ5PNg+_O1Q5bgg@mail.gmail.com>
Date:   Fri, 11 Feb 2022 16:10:52 -0800
From:   Nick Desaulniers <ndesaulniers@...gle.com>
To:     Sami Tolvanen <samitolvanen@...gle.com>,
        Kees Cook <keescook@...omium.org>
Cc:     llvm@...ts.linux.dev, Alexey Kardashevskiy <aik@...abs.ru>,
        linux-kernel@...r.kernel.org, Steven Rostedt <rostedt@...dmis.org>,
        Nathan Chancellor <nathan@...nel.org>,
        Ingo Molnar <mingo@...hat.com>
Subject: Re: [RFC PATCH kernel] trace: Make FTRACE_MCOUNT_USE_RECORDMCOUNT configurable

+ Sami, Kees

Do you guys remember why we don't support
FTRACE_MCOUNT_USE_RECORDMCOUNT with LTO?
https://patchwork.kernel.org/project/linux-kbuild/patch/20201013003203.4168817-12-samitolvanen@google.com/?

On Thu, Feb 10, 2022 at 5:43 PM Alexey Kardashevskiy <aik@...abs.ru> wrote:
>
> For whatever reason LLVM does not allow LTO (Link Time Optimization) if
> FTRACE_MCOUNT_USE_RECORDMCOUNT is enabled.
>
> This allows disabling just this option instead of disabling all FTRACE
> options.
>
> Signed-off-by: Alexey Kardashevskiy <aik@...abs.ru>
> ---
>
> Or disabling FTRACE is the right thing to do if HAS_LTO_CLANG=y?
>
> Came from arch/Kconfig:
>
> config HAS_LTO_CLANG
>         def_bool y
>         depends on CC_IS_CLANG && LD_IS_LLD && AS_IS_LLVM
>         depends on $(success,$(NM) --help | head -n 1 | grep -qi llvm)
>         depends on $(success,$(AR) --help | head -n 1 | grep -qi llvm)
>         depends on ARCH_SUPPORTS_LTO_CLANG
>         depends on !FTRACE_MCOUNT_USE_RECORDMCOUNT  <======
>         depends on !KASAN || KASAN_HW_TAGS
>         depends on !GCOV_KERNEL
>
>
> ---
>  kernel/trace/Kconfig | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
> index a5eb5e7fd624..87d82d2b0b0b 100644
> --- a/kernel/trace/Kconfig
> +++ b/kernel/trace/Kconfig
> @@ -704,7 +704,8 @@ config FTRACE_MCOUNT_USE_OBJTOOL
>         depends on FTRACE_MCOUNT_RECORD
>
>  config FTRACE_MCOUNT_USE_RECORDMCOUNT
> -       def_bool y
> +       bool "Enable FTRACE_MCOUNT_USE_RECORDMCOUNT"
> +       default y
>         depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
>         depends on !FTRACE_MCOUNT_USE_CC
>         depends on !FTRACE_MCOUNT_USE_OBJTOOL
> --
> 2.30.2
>


-- 
Thanks,
~Nick Desaulniers

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ