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: <88414f3498d84e76ba358119d633d62a@AcuMS.aculab.com>
Date:   Fri, 25 Feb 2022 13:09:34 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     'Peter Zijlstra' <peterz@...radead.org>,
        Kees Cook <keescook@...omium.org>
CC:     "x86@...nel.org" <x86@...nel.org>,
        "joao@...rdrivepizza.com" <joao@...rdrivepizza.com>,
        "hjl.tools@...il.com" <hjl.tools@...il.com>,
        "jpoimboe@...hat.com" <jpoimboe@...hat.com>,
        "andrew.cooper3@...rix.com" <andrew.cooper3@...rix.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "ndesaulniers@...gle.com" <ndesaulniers@...gle.com>,
        "samitolvanen@...gle.com" <samitolvanen@...gle.com>,
        "mark.rutland@....com" <mark.rutland@....com>,
        "alyssa.milburn@...el.com" <alyssa.milburn@...el.com>,
        "mbenes@...e.cz" <mbenes@...e.cz>,
        "rostedt@...dmis.org" <rostedt@...dmis.org>,
        "mhiramat@...nel.org" <mhiramat@...nel.org>,
        "alexei.starovoitov@...il.com" <alexei.starovoitov@...il.com>
Subject: RE: [PATCH v2 11/39] x86/ibt,kvm: Add ENDBR to fastops

From: Peter Zijlstra
> Sent: 25 February 2022 10:25
> 
> On Thu, Feb 24, 2022 at 04:54:04PM -0800, Kees Cook wrote:
> > On Thu, Feb 24, 2022 at 03:51:49PM +0100, Peter Zijlstra wrote:
> > >
> > > Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> > > ---
> > >  arch/x86/kvm/emulate.c |    6 ++++--
> > >  1 file changed, 4 insertions(+), 2 deletions(-)
> > >
> > > --- a/arch/x86/kvm/emulate.c
> > > +++ b/arch/x86/kvm/emulate.c
> > > @@ -189,7 +189,7 @@
> > >  #define X16(x...) X8(x), X8(x)
> > >
> > >  #define NR_FASTOP (ilog2(sizeof(ulong)) + 1)
> > > -#define FASTOP_SIZE 8
> > > +#define FASTOP_SIZE (8 * (1 + HAS_KERNEL_IBT))

Defining as:
		(8 + HAS_KERNEL_IBT * 8)
would probably be easier to read when half asleep.

	David

> >
> > Err, is this right? FASTOP_SIZE is used both as a size and an alignment.
> > But the ENDBR instruction is 4 bytes? Commit log maybe needed to
> > describe this.
> 
> Note how that comes out as 8*1 or 8*2, iow 8 or 16. Does that clarify?
> That is, 8+4 being 12 is ovbiuosly a fail for alignment.

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ