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: <YzKmaCczYFk6k8S/@hirez.programming.kicks-ass.net>
Date:   Tue, 27 Sep 2022 09:29:44 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     "H.J. Lu" <hjl.tools@...il.com>
Cc:     Sami Tolvanen <samitolvanen@...gle.com>,
        linux-kernel@...r.kernel.org, Kees Cook <keescook@...omium.org>,
        Josh Poimboeuf <jpoimboe@...hat.com>, x86@...nel.org,
        Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Nathan Chancellor <nathan@...nel.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Joao Moreira <joao@...rdrivepizza.com>,
        Sedat Dilek <sedat.dilek@...il.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        linux-hardening@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, llvm@...ts.linux.dev
Subject: Re: [PATCH v5 00/22] KCFI support

On Mon, Sep 26, 2022 at 01:16:04PM -0700, H.J. Lu wrote:
> On Mon, Sep 26, 2022 at 5:39 AM Peter Zijlstra <peterz@...radead.org> wrote:
> >
> > On Thu, Sep 08, 2022 at 02:54:42PM -0700, Sami Tolvanen wrote:
> > > KCFI is a forward-edge control-flow integrity scheme in the upcoming
> > > Clang 16 release, which is more suitable for kernel use than the
> > > existing CFI scheme used by CONFIG_CFI_CLANG. KCFI doesn't require
> > > LTO, doesn't alter function references to point to a jump table, and
> > > won't break function address equality.
> > >
> > > This series replaces the current arm64 CFI implementation with KCFI
> > > and adds support for x86_64.
> > >
> > > KCFI requires assembly functions that are indirectly called from C
> > > code to be annotated with type identifiers. As type information is
> > > only available in C, the compiler emits expected type identifiers
> > > into the symbol table, so they can be referenced from assembly
> > > without having to hardcode type hashes. Patch 6 adds helper macros
> > > for annotating functions, and patches 9 and 20 add annotations.
> > >
> > > In case of a type mismatch, KCFI always traps. To support error
> > > handling, the compiler generates a .kcfi_traps section for x86_64,
> > > which contains the locations of each trap, and for arm64, encodes
> > > the necessary register information to the ESR. Patches 10 and 22 add
> > > arch-specific error handlers.
> > >
> > > To test this series, you'll need a ToT Clang toolchain. The series
> > > is also available pn GitHub:
> > >
> > >   https://github.com/samitolvanen/linux/commits/kcfi-v5
> >
> > As mentioned at plumbers, my only concern is somewhat excessive use of
> > CFI_CLANG as oposed to something more compiler neutral. But I suppose
> > that's something we can cleanup/fix when GCC grows support for this.
> >
> > Acked-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> > Tested-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> >
> > (as in I ran kCFI + call-depth-tracking + FineIBT on a bunch of
> > hardware)
> >
> > HJL, can you look at adding kCFI support to GCC ?
> 
> Adding -fsanitize=kcfi to GCC is a big effort.  Please open a
> GCC bug:
> 
> https://gcc.gnu.org/bugzilla/enter_bug.cgi?product=gcc

Here goes:

  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107048

Powered by blists - more mailing lists