[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230621085104.GH2046280@hirez.programming.kicks-ass.net>
Date: Wed, 21 Jun 2023 10:51:04 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Sami Tolvanen <samitolvanen@...gle.com>
Cc: Kees Cook <keescook@...omium.org>, x86@...nel.org,
alyssa.milburn@...ux.intel.com, linux-kernel@...r.kernel.org,
jpoimboe@...nel.org, joao@...rdrivepizza.com,
tim.c.chen@...ux.intel.com
Subject: Re: [PATCH 2/2] x86/fineibt: Poison ENDBR at +0
On Tue, Jun 20, 2023 at 05:04:50PM -0700, Sami Tolvanen wrote:
> On Tue, Jun 20, 2023 at 2:55 PM Kees Cook <keescook@...omium.org> wrote:
> >
> > On Thu, Jun 15, 2023 at 09:35:48PM +0200, Peter Zijlstra wrote:
> > > Alyssa noticed that when building the kernel with CFI_CLANG+IBT and
> > > booting on IBT enabled hardware obtain FineIBT, the indirect functions
> > > look like:
> > >
> > > __cfi_foo:
> > > endbr64
> > > subl $hash, %r10d
> > > jz 1f
> > > ud2
> > > nop
> > > 1:
> > > foo:
> > > endbr64
> > >
> > > This is because clang currently does not supress ENDBR emission for
> > > functions it provides a __cfi prologue symbol for.
> >
> > Should this be considered a bug in Clang?
>
> The endbr is needed with KCFI if we have FineIBT disabled for some
> reason. There's some discussion here:
>
> https://github.com/ClangBuiltLinux/linux/issues/1735
>
> However, since the kernel handles FineIBT patching, it might be
> cleaner to let it also poison the extra endbr.
That's what I get for replying before reading all replies. Anyway, we're
in agreement.
Powered by blists - more mailing lists