[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220216122429.GB86719@worktop.programming.kicks-ass.net>
Date: Wed, 16 Feb 2022 13:24:29 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Kees Cook <keescook@...omium.org>
Cc: Sami Tolvanen <samitolvanen@...gle.com>,
Joao Moreira <joao@...rdrivepizza.com>,
X86 ML <x86@...nel.org>, hjl.tools@...il.com,
Josh Poimboeuf <jpoimboe@...hat.com>,
andrew.cooper3@...rix.com, LKML <linux-kernel@...r.kernel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
llvm@...ts.linux.dev
Subject: Re: [RFC][PATCH 6/6] objtool: Add IBT validation / fixups
On Tue, Feb 15, 2022 at 10:05:50PM +0100, Peter Zijlstra wrote:
> > Peter, is there a reason you want things in the specific order of:
> >
> > cmp, je-to-call, trap, call
> >
> > Isn't it more run-time efficient to have an out-of-line failure of
> > the form:
> >
> > cmp, jne-to-trap, call, ...code..., trap, jmp-to-call
> >
> > I thought the static label stuff allowed the "default out of line"
> > option, as far as pessimizing certain states, etc? The former is certainly
> > code-size smaller, though, yes, but doesn't it waste space in the cache
> > line for the unlikely case, etc?
>
> Mostly so that we can deduce the address of the trap from the retpoline
> site, also the above has a fairly high chance of using jcc.d32 which is
> actually larger than jcc.d8+ud2.
Also; and I think I mentioned this a few emails back, by having the
whole CFI thing as a single range of bytes it becomes easier to patch.
Powered by blists - more mailing lists