mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: David Laight <David.Laight@aculab.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 08:00:35 -0500	[thread overview]
Message-ID: <20200909130035.4tzata2gwd6fahoe@treble> (raw)
In-Reply-To: <20200909124644.dndmfnoob5qzd7xi@treble>

On Wed, Sep 09, 2020 at 07:46:51AM -0500, Josh Poimboeuf wrote:
> 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?

Looks like the set_fs() removal patches are now in the vfs tree for
-next.  I doubt this is going in an -rc so I'll rework the patch based
on top of Christoph's changes.

-- 
Josh


  reply	other threads:[~2020-09-09 13:10 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 [this message]
2020-09-09 13:46       ` David Laight

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=20200909130035.4tzata2gwd6fahoe@treble \
    --to=jpoimboe@redhat.com \
    --cc=David.Laight@aculab.com \
    --cc=aarcange@redhat.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dan.j.williams@intel.com \
    --cc=hch@lst.de \
    --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®