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] [day] [month] [year] [list]
Message-ID: <F65B8613-D747-457D-8E23-D553D727B4E1@jkl820.local>
Date:   Wed, 19 Jul 2023 00:27:40 +0200
From:   Jakob Koschel <jkl820.git@...il.com>
To:     Nick Desaulniers <ndesaulniers@...gle.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Nathan Chancellor <nathan@...nel.org>,
        Tom Rix <trix@...hat.com>, Kees Cook <keescook@...omium.org>,
        linux-kernel@...r.kernel.org, llvm@...ts.linux.dev
Subject: Re: [PATCH v2] arch: enable HAS_LTO_CLANG with KASAN and KCOV

On 23/07/18 10:50AM, Nick Desaulniers wrote:
> On Mon, Jul 17, 2023 at 11:49 PM Jakob Koschel <jkl820.git@...il.com> wrote:
> >
> > Both KASAN and KCOV had issues with LTO_CLANG if DEBUG_INFO is enabled.
> > With LTO inlinable function calls are required to have debug info if
> > they are inlined into a function that has debug info.
> >
> > Starting with LLVM 17 this will be fixed ([1],[2]) and enabling LTO with
> > KASAN/KCOV and DEBUG_INFO doesn't cause linker errors anymore.
> >
> > Link: https://github.com/llvm/llvm-project/commit/913f7e93dac67ecff47bade862ba42f27cb68ca9
> > Link: https://github.com/llvm/llvm-project/commit/4a8b1249306ff11f229320abdeadf0c215a00400
> > Reviewed-by: Nathan Chancellor <nathan@...nel.org>
> > Signed-off-by: Jakob Koschel <jkl820.git@...il.com>
> > ---
> > Changes in v2:
> > - Added correct To:/Cc:
> > - Added comment about required LLVM 17 version dependency
> > - Link to v1: https://lore.kernel.org/r/20230717-enable-kasan-lto1-v1-1-471e706a5c4e@gmail.com
> > ---
> >  arch/Kconfig | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/Kconfig b/arch/Kconfig
> > index aff2746c8af2..d722bcfcc870 100644
> > --- a/arch/Kconfig
> > +++ b/arch/Kconfig
> > @@ -745,7 +745,10 @@ config HAS_LTO_CLANG
> >         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
> > +       # KASAN & KCOV were missing necessary debug information prior to LLVM 17
> > +       # which are required with LTO.
> 
> Hi Jakob,
> Thanks for follow up with a v2.  I think Nathan meant he was literally
> looking for a link here in the comment, like:
> 
> # https://github.com/ClangBuiltLinux/linux/issues/1721
> 
> Mind sending a v3 with that? You can replace the comment you added to
> arch/Kconfig in v2 outright with that link.
> 
> If folks need to know more they can follow that link or run git blame on it.

Ha, that's on me when copying from the other email I shamelessly forgot the
most important line.

Will make a v3, sorry about that.

> 
> > +       depends on (!KASAN || KASAN_HW_TAGS || CLANG_VERSION >= 170000) || !DEBUG_INFO
> > +       depends on (!KCOV || CLANG_VERSION >= 170000) || !DEBUG_INFO
> >         depends on !GCOV_KERNEL
> >         help
> >           The compiler and Kconfig options support building with Clang's
> >
> > ---
> > base-commit: fdf0eaf11452d72945af31804e2a1048ee1b574c
> > change-id: 20230717-enable-kasan-lto1-656754c76241
> >
> > Best regards,
> > --
> > Jakob Koschel <jkl820.git@...il.com>
> >
> 
> 
> -- 
> Thanks,
> ~Nick Desaulniers

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ