linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@linux.intel.com>
To: Andy Lutomirski <luto@kernel.org>, Thomas Gleixner <tglx@linutronix.de>
Cc: Lars Wendler <wendler.lars@web.de>,
	LKML <linux-kernel@vger.kernel.org>, X86 ML <x86@kernel.org>,
	Borislav Betkov <bp@alien8.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Greg KH <gregkh@linuxfoundation.org>,
	Laura Abbott <labbott@redhat.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Juergen Gross <jgross@suse.com>
Subject: Re: CONFIG_PAGE_TABLE_ISOLATION=y on x86_64 causes gcc to segfault when building x86_32 binaries
Date: Wed, 3 Jan 2018 14:27:17 -0800	[thread overview]
Message-ID: <e29cbd54-95f2-52ed-508e-12c1c2520bfb@linux.intel.com> (raw)
In-Reply-To: <CALCETrW8RD2vtcUjYoq07DEiLoXYxqXuxD7xujOtuF=UGjNYvw@mail.gmail.com>

On 01/03/2018 02:14 PM, Andy Lutomirski wrote:
> +       /* Use %rsp as scratch reg. User ESP is stashed in r8 */
> +       SWITCH_TO_KERNEL_CR3 scratch_reg=%rsp
> +
> +       /* Switch to the kernel stack */
>         movq    PER_CPU_VAR(cpu_current_top_of_stack), %rsp

The stack is unreadable at this point without the CR3 switch.

> What's the issue that this is fixing?

Users doing 32-bit SYSCALLs on the CPUs that support them double fault
since they end up with an %rsp that they can't access.

  parent reply	other threads:[~2018-01-03 22:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180103123723.1dd26828@abudhabi.paradoxon.rec>
2018-01-03 11:57 ` CONFIG_PAGE_TABLE_ISOLATION=y on x86_64 causes gcc to segfault when building x86_32 binaries Thomas Gleixner
2018-01-03 12:05   ` Thomas Gleixner
2018-01-03 13:30     ` Lars Wendler
2018-01-03 15:21       ` Thomas Gleixner
2018-01-03 15:42         ` Dave Hansen
2018-01-03 18:52         ` Thomas Gleixner
2018-01-03 22:12           ` Laura Abbott
2018-01-03 22:14           ` Andy Lutomirski
2018-01-03 22:22             ` Thomas Gleixner
2018-01-03 23:43               ` Andy Lutomirski
2018-01-03 22:27             ` Dave Hansen [this message]
2018-01-03 22:25           ` [tip:x86/pti] x86/pti: Switch to kernel CR3 at early in entry_SYSCALL_compat() tip-bot for Thomas Gleixner
2018-01-03 23:46           ` CONFIG_PAGE_TABLE_ISOLATION=y on x86_64 causes gcc to segfault when building x86_32 binaries Lars Wendler
2018-01-04  2:44           ` Boris Ostrovsky
2018-01-03 15:40       ` Borislav Petkov
2018-01-03 23:22         ` Lars Wendler

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=e29cbd54-95f2-52ed-508e-12c1c2520bfb@linux.intel.com \
    --to=dave.hansen@linux.intel.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=bp@alien8.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=jgross@suse.com \
    --cc=labbott@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=wendler.lars@web.de \
    --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;
as well as URLs for NNTP newsgroup(s).