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: <CALCETrUFS26aFwQxggQaRT5XvOfXDYdxz2a1J-Mw-L9hzbj0vA@mail.gmail.com>
Date:	Thu, 17 Mar 2016 18:43:51 -0700
From:	Andy Lutomirski <luto@...capital.net>
To:	Borislav Petkov <bp@...en8.de>
Cc:	X86 ML <x86@...nel.org>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] x86/cpu: Do the feature test first in enable_sep_cpu()

On Wed, Mar 16, 2016 at 5:19 AM, Borislav Petkov <bp@...en8.de> wrote:
> From: Borislav Petkov <bp@...e.de>
>
> ... before assigning local vars. Kill out label too and simplify.
>
> No functionality change.

Acked-by: Andy Lutomirski <luto@...nel.org>

>
> Signed-off-by: Borislav Petkov <bp@...e.de>
> ---
>  arch/x86/kernel/cpu/common.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
> index 249461f95851..63658d23d3dd 100644
> --- a/arch/x86/kernel/cpu/common.c
> +++ b/arch/x86/kernel/cpu/common.c
> @@ -1030,12 +1030,12 @@ void enable_sep_cpu(void)
>         struct tss_struct *tss;
>         int cpu;
>
> +       if (!boot_cpu_has(X86_FEATURE_SEP))
> +               return;
> +
>         cpu = get_cpu();
>         tss = &per_cpu(cpu_tss, cpu);
>
> -       if (!boot_cpu_has(X86_FEATURE_SEP))
> -               goto out;
> -
>         /*
>          * We cache MSR_IA32_SYSENTER_CS's value in the TSS's ss1 field --
>          * see the big comment in struct x86_hw_tss's definition.
> @@ -1050,7 +1050,6 @@ void enable_sep_cpu(void)
>
>         wrmsr(MSR_IA32_SYSENTER_EIP, (unsigned long)entry_SYSENTER_32, 0);
>
> -out:
>         put_cpu();
>  }
>  #endif
> --
> 2.7.3
>



-- 
Andy Lutomirski
AMA Capital Management, LLC

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ