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-next>] [day] [month] [year] [list]
Message-ID: <41ab203e-4ebd-083f-62c6-f10e649c6bb6@intel.com>
Date:   Thu, 5 Jul 2018 10:14:18 -0700
From:   Dave Hansen <dave.hansen@...el.com>
To:     Andy Lutomirski <luto@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        LKML <linux-kernel@...r.kernel.org>,
        the arch/x86 maintainers <x86@...nel.org>
Subject: kernel %rsp code at sysenter PTI vs no-PTI

The PTI path does this:

	...
        SWITCH_TO_KERNEL_CR3 scratch_reg=%rsp
        /* Load the top of the task stack into RSP */
        movq    CPU_ENTRY_AREA_tss + TSS_sp1 + CPU_ENTRY_AREA, %rsp

And the non-PTI entry path does this:

	...
        movq    %rsp, PER_CPU_VAR(rsp_scratch)
        movq    PER_CPU_VAR(cpu_current_top_of_stack), %rsp

Both "mov ___, %rsp" instructions have the kernel %GS value in place and
both are running on a good kernel CR3.  Does anybody remember why we
don't use cpu_current_top_of_stack in the PTI-on case?

I'm wondering if it was because we, at some point, did the mov ...,
%rsp before CR3 was good.  But it doesn't look like we do that now, so
should we maybe make both copies do:

	movq    PER_CPU_VAR(cpu_current_top_of_stack), %rsp

for consistency?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ