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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YNHwk774s1/RI2/q@zn.tnic>
Date:   Tue, 22 Jun 2021 16:15:47 +0200
From:   Borislav Petkov <bp@...e.de>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Andy Lutomirski <luto@...nel.org>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        Fenghua Yu <fenghua.yu@...el.com>,
        Tony Luck <tony.luck@...el.com>,
        Yu-cheng Yu <yu-cheng.yu@...el.com>,
        Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
        Peter Zijlstra <peterz@...radead.org>,
        Kan Liang <kan.liang@...ux.intel.com>
Subject: Re: [patch V3 41/66] x86/cpu: Sanitize X86_FEATURE_OSPKE

On Fri, Jun 18, 2021 at 04:19:04PM +0200, Thomas Gleixner wrote:
> X86_FEATURE_OSPKE is enabled first on the boot CPU and the feature flag is
> set. Secondary CPUs have to enable CR4.PKE as well and set their per CPU
> feature flag. That's ineffective because all call sites have checks for
> boot_cpu_data.
> 
> Make it smarter and force the feature flag when PKU is enabled on the boot
> cpu which allows then to use cpu_feature_enabled(X86_FEATURE_OSPKE) all
> over the place. That either compiles the code out when PKEY support is
> disabled in Kconfig or uses a static_cpu_has() for the feature check which
> makes a significant difference in hotpathes, e.g. context switch.

"hotpaths"

> 
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> ---
>  arch/x86/include/asm/pkeys.h |    8 ++++----
>  arch/x86/include/asm/pkru.h  |    4 ++--
>  arch/x86/kernel/cpu/common.c |   24 +++++++++++-------------
>  arch/x86/kernel/fpu/core.c   |    2 +-
>  arch/x86/kernel/fpu/xstate.c |    2 +-
>  arch/x86/kernel/process_64.c |    2 +-
>  arch/x86/mm/fault.c          |    2 +-
>  7 files changed, 21 insertions(+), 23 deletions(-)

Other than that:

Reviewed-by: Borislav Petkov <bp@...e.de>

-- 
Regards/Gruss,
    Boris.

SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer, HRB 36809, AG Nürnberg

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ