mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Josh Poimboeuf' <jpoimboe@redhat.com>
Cc: "x86@kernel.org" <x86@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Al Viro <viro@zeniv.linux.org.uk>,
	"Will Deacon" <will@kernel.org>,
	Dan Williams <dan.j.williams@intel.com>,
	"Andrea Arcangeli" <aarcange@redhat.com>,
	Waiman Long <longman@redhat.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	Andy Lutomirski <luto@kernel.org>, Christoph Hellwig <hch@lst.de>,
	Mark Rutland <mark.rutland@arm.com>
Subject: RE: [PATCH v2] x86/uaccess: Use pointer masking to limit uaccess speculation
Date: Wed, 9 Sep 2020 13:46:24 +0000	[thread overview]
Message-ID: <26e7028623624b7db6d4e39875274933@AcuMS.aculab.com> (raw)
In-Reply-To: <20200909124644.dndmfnoob5qzd7xi@treble>

From: Josh Poimboeuf
> Sent: 09 September 2020 13:47
> On Wed, Sep 09, 2020 at 08:20:07AM +0000, David Laight wrote:
> > From: Josh Poimboeuf <jpoimboe@redhat.com>
> > > Sent: 08 September 2020 18:43
> > > Hi x86 maintainers,
> > ...
> > > > --- a/arch/x86/lib/putuser.S
> > > > +++ b/arch/x86/lib/putuser.S
> > > > @@ -38,6 +38,8 @@ SYM_FUNC_START(__put_user_1)
> > > >  	ENTER
> > > >  	cmp TASK_addr_limit(%_ASM_BX),%_ASM_CX
> > > >  	jae .Lbad_put_user
> > > > +	sbb %_ASM_BX, %_ASM_BX		/* uaccess_mask_ptr() */
> > > > +	and %_ASM_BX, %_ASM_CX
> > > >  	ASM_STAC
> > > >  1:	movb %al,(%_ASM_CX)
> > > >  	xor %eax,%eax
> >
> > For 64bit the sbb+and pattern can be replaced by an instruction
> > that clears the high bit (eg btr $63, %rcx).
> > This isn't dependant on the earlier instructions so can execute
> > in parallel with them.
> 
> Wouldn't that break with KERNEL_DS?

I think that has already all been removed from x86.

	David

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

      parent reply	other threads:[~2020-09-09 16:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-01 15:30 Josh Poimboeuf
2020-09-08 17:43 ` Josh Poimboeuf
2020-09-09  8:20   ` David Laight
2020-09-09 12:46     ` Josh Poimboeuf
2020-09-09 13:00       ` Josh Poimboeuf
2020-09-09 13:46       ` David Laight [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=26e7028623624b7db6d4e39875274933@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=aarcange@redhat.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dan.j.williams@intel.com \
    --cc=hch@lst.de \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=luto@kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=will@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®