[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YtWMiyem8+N4vbKE@worktop.programming.kicks-ass.net>
Date: Mon, 18 Jul 2022 18:38:35 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Borislav Petkov <bp@...e.de>
Cc: Thadeu Lima de Souza Cascardo <cascardo@...onical.com>,
linux-kernel@...r.kernel.org, linux-efi@...r.kernel.org,
x86@...nel.org, ardb@...nel.org, tglx@...utronix.de,
gregkh@...uxfoundation.org, torvalds@...ux-foundation.org,
Guenter Roeck <linux@...ck-us.net>,
Josh Poimboeuf <jpoimboe@...nel.org>, stable@...r.kernel.org,
Andrew Cooper <Andrew.Cooper3@...rix.com>
Subject: Re: [PATCH] efi/x86: use naked RET on mixed mode call wrapper
On Mon, Jul 18, 2022 at 06:28:27PM +0200, Borislav Petkov wrote:
> On Mon, Jul 18, 2022 at 01:41:37PM +0200, Peter Zijlstra wrote:
> > diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h
> > index 10a3bfc1eb23..f934dcdb7c0d 100644
> > --- a/arch/x86/include/asm/nospec-branch.h
> > +++ b/arch/x86/include/asm/nospec-branch.h
> > @@ -297,6 +297,8 @@ do { \
> > alternative_msr_write(MSR_IA32_SPEC_CTRL, \
> > spec_ctrl_current() | SPEC_CTRL_IBRS, \
> > X86_FEATURE_USE_IBRS_FW); \
> > + altnerative_msr_write(MSR_IA32_PRED_CMD, PRED_CMD_IBPB, \
> > + X86_FEATURE_USE_IBPB_FW); \
> > } while (0)
>
> So I'm being told we need to untrain on return from EFI to protect the
> kernel from it. Ontop of yours.
I don't think there's any credible way we can protect against EFI taking
over the system if it wants to. It runs at CPL0 and has access to the
direct map. If EFI wants it can take over the system without trying.
Powered by blists - more mailing lists