[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YhdLdMiVgeYOGP/H@hirez.programming.kicks-ass.net>
Date: Thu, 24 Feb 2022 10:10:12 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Joao Moreira <joao@...rdrivepizza.com>
Cc: x86@...nel.org, hjl.tools@...il.com, jpoimboe@...hat.com,
andrew.cooper3@...rix.com, linux-kernel@...r.kernel.org,
ndesaulniers@...gle.com, keescook@...omium.org,
samitolvanen@...gle.com, mark.rutland@....com,
alyssa.milburn@...el.com
Subject: Re: [PATCH 24/29] x86/text-patching: Make text_gen_insn() IBT aware
On Wed, Feb 23, 2022 at 05:18:04PM -0800, Joao Moreira wrote:
> > +#ifdef CONFIG_X86_IBT
> > + if (is_endbr(dest))
> > + dest += 4;
> > +#endif
>
> Hi, FWIIW I saw this snippet trigger a bug in the jump_label infra where the
> target displacement would not fit in a JMP8 operand.
Bah, I was afraid of seening that :/
> For these cases perhaps we can verify if the displacement fits the operand
> and, if not, simply ignore and lose the decode cycle which may not be a huge
> problem and remains semantically correct. Seems more sensible than padding
> jump tables with nops. In the meantime I'll investigate clang's behavior and
> if it is really a bug, I'll work on a patch.
Urgh, trouble is, we're going to be re-writing a bunch of ENDBR to be
UD1 0x0(%eax),%eax, and you really don't want to try and execute those.
Powered by blists - more mailing lists