All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: David Vrabel <david.vrabel@citrix.com>
Cc: Jan Beulich <JBeulich@suse.com>, <xen-devel@lists.xenproject.org>,
	<boris.ostrovsky@oracle.com>, <srostedt@redhat.com>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [Xen-devel] [PATCH] x86/xen: Fix 32-bit PV guests's usage of kernel_stack
Date: Wed, 9 Apr 2014 15:41:37 +0100	[thread overview]
Message-ID: <53455C21.6000408@citrix.com> (raw)
In-Reply-To: <53455933.2060406@citrix.com>

On 09/04/14 15:29, David Vrabel wrote:
> On 09/04/14 15:21, Jan Beulich wrote:
>>>>> On 09.04.14 at 16:06, <boris.ostrovsky@oracle.com> wrote:
>>> --- a/arch/x86/xen/xen-asm_32.S
>>> +++ b/arch/x86/xen/xen-asm_32.S
>>> @@ -88,7 +88,11 @@ ENTRY(xen_iret)
>>>  	 * avoid having to reload %fs
>>>  	 */
>>>  #ifdef CONFIG_SMP
>>> +	pushw %fs
>>> +	movl $(__KERNEL_PERCPU), %eax
>>> +	movl %eax, %fs
>>>  	GET_THREAD_INFO(%eax)
>>> +	popw %fs
>> I don't think it's guaranteed that this can't fault.
> If loading %fs faults when it is restored previously, the fixup zeros
> the value.  However, this later load could still fault even if the first
> succeeded.
>
> Suggest copying the fixup section from the RESTORE_REGS macros in
> arch/x86/kernel/entry_32.S
>
> David

If loading __KERNEL_PERCPU info fs faults, the kernel has bigger
problems to worry about.

The latter load however can easy fault; The arguments for %ds in 
XSA-42/ CVE-2013-0228 applies to %{e,f,g}s as well.

Furthermore, I am a little concerned about the performance impact of
this.  I would have thought that in most cases, %fs will already be
correct, at which point reloading it twice is a waste of time.

~Andrew

  parent reply	other threads:[~2014-04-09 14:41 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-09 14:06 [PATCH] x86/xen: Fix 32-bit PV guests's usage of kernel_stack Boris Ostrovsky
2014-04-09 14:08 ` David Vrabel
2014-04-09 14:08 ` David Vrabel
2014-04-09 14:21 ` [Xen-devel] " Jan Beulich
2014-04-09 14:29   ` David Vrabel
2014-04-09 14:29   ` [Xen-devel] " David Vrabel
2014-04-09 14:41     ` Andrew Cooper
2014-04-09 14:41     ` Andrew Cooper [this message]
2014-04-09 15:01       ` [Xen-devel] " Jan Beulich
2014-04-09 15:38         ` Boris Ostrovsky
2014-04-09 15:40           ` Jan Beulich
2014-04-09 15:40           ` [Xen-devel] " Jan Beulich
2014-04-09 15:38         ` Boris Ostrovsky
2014-04-09 15:01       ` Jan Beulich
2014-04-09 14:21 ` Jan Beulich
2014-04-09 15:25 ` Steven Rostedt
2014-04-09 15:25 ` Steven Rostedt
2014-04-09 16:15   ` Boris Ostrovsky
2014-04-09 16:15   ` Boris Ostrovsky

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=53455C21.6000408@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=srostedt@redhat.com \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.