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: <20230821161706.s62ecp7zhiunt5oy@treble>
Date:   Mon, 21 Aug 2023 09:17:06 -0700
From:   Josh Poimboeuf <jpoimboe@...nel.org>
To:     Borislav Petkov <bp@...en8.de>
Cc:     x86@...nel.org, linux-kernel@...r.kernel.org,
        Peter Zijlstra <peterz@...radead.org>,
        Babu Moger <babu.moger@....com>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Sean Christopherson <seanjc@...gle.com>, David.Kaplan@....com,
        Andrew Cooper <andrew.cooper3@...rix.com>,
        Nikolay Borisov <nik.borisov@...e.com>,
        gregkh@...uxfoundation.org, Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH 01/22] x86/srso: Fix srso_show_state() side effect

On Mon, Aug 21, 2023 at 08:04:16AM +0200, Borislav Petkov wrote:
> On Sun, Aug 20, 2023 at 06:18:58PM -0700, Josh Poimboeuf wrote:
> > Reading the 'spec_rstack_overflow' sysfs file can trigger an unnecessary
> > MSR write, and possibly even a (handled) exception if the microcode
> > hasn't been updated.
> > 
> > Avoid all that by just checking X86_FEATURE_IBPB_BRTYPE instead, which
> > gets set by srso_select_mitigation() if the updated microcode exists.
> > 
> > Fixes: fb3bd914b3ec ("x86/srso: Add a Speculative RAS Overflow mitigation")
> > Signed-off-by: Josh Poimboeuf <jpoimboe@...nel.org>
> > ---
> >  arch/x86/kernel/cpu/bugs.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
> > index f081d26616ac..bdd3e296f72b 100644
> > --- a/arch/x86/kernel/cpu/bugs.c
> > +++ b/arch/x86/kernel/cpu/bugs.c
> > @@ -2717,7 +2717,7 @@ static ssize_t srso_show_state(char *buf)
> >
> 
> Please put here a comment - something along the lines of:
> 
> "X86_FEATURE_IBPB_BRTYPE gets set as a result of the presence of the
> needed microcode so checking that is equivalent."
> 
> so that it is clear why it is ok to check this feature bit.

I could do that, but this check ends up getting replaced by a later
patch anyway.

Would you want this comment in srso_select_mitigation()?  After the next
patch it has:

  bool has_microcode = boot_cpu_has(X86_FEATURE_IBPB_BRTYPE);

Though that seems clear to me already.

-- 
Josh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ