[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202502251033.B8216DDA3@keescook>
Date: Tue, 25 Feb 2025 10:33:41 -0800
From: Kees Cook <kees@...nel.org>
To: David Laight <david.laight.linux@...il.com>
Cc: Peter Zijlstra <peterz@...radead.org>, x86@...nel.org,
linux-kernel@...r.kernel.org, alyssa.milburn@...el.com,
scott.d.constable@...el.com, joao@...rdrivepizza.com,
andrew.cooper3@...rix.com, jpoimboe@...nel.org,
jose.marchesi@...cle.com, hjl.tools@...il.com,
ndesaulniers@...gle.com, samitolvanen@...gle.com, nathan@...nel.org,
ojeda@...nel.org, alexei.starovoitov@...il.com, mhiramat@...nel.org,
jmill@....edu
Subject: Re: [PATCH v4 06/10] x86/traps: Decode LOCK Jcc.d8 #UD
On Mon, Feb 24, 2025 at 09:46:12PM +0000, David Laight wrote:
> On Mon, 24 Feb 2025 13:37:09 +0100
> Peter Zijlstra <peterz@...radead.org> wrote:
>
> > Because overlapping code sequences are all the rage.
> >
> > Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> > Reviewed-by: Kees Cook <kees@...nel.org>
> > ---
> > arch/x86/include/asm/bug.h | 2 ++
> > arch/x86/kernel/traps.c | 26 +++++++++++++++++++++++---
> > 2 files changed, 25 insertions(+), 3 deletions(-)
> >
> > --- a/arch/x86/include/asm/bug.h
> > +++ b/arch/x86/include/asm/bug.h
> > @@ -17,6 +17,7 @@
> > * In clang we have UD1s reporting UBSAN failures on X86, 64 and 32bit.
> > */
> > #define INSN_ASOP 0x67
> > +#define INSN_LOCK 0xf0
> > #define OPCODE_ESCAPE 0x0f
> > #define SECOND_BYTE_OPCODE_UD1 0xb9
> > #define SECOND_BYTE_OPCODE_UD2 0x0b
> > @@ -26,6 +27,7 @@
> > #define BUG_UD1 0xfffd
> > #define BUG_UD1_UBSAN 0xfffc
> > #define BUG_EA 0xffea
> > +#define BUG_LOCK 0xfff0
> >
> > #ifdef CONFIG_GENERIC_BUG
> >
> > --- a/arch/x86/kernel/traps.c
> > +++ b/arch/x86/kernel/traps.c
> > @@ -97,6 +97,7 @@ __always_inline int is_valid_bugaddr(uns
> > * If it's a UD1, further decode to determine its use:
> > *
> > * FineIBT: ea (bad)
> > + * FineIBT: 0f 75 f9 lock jne . - 6
> ^^ nibble swapped
Oh, good catch!
--
Kees Cook
Powered by blists - more mailing lists