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: <CAMj1kXGOegcJhOOiyw_0A0Y1GW0K3LqBuhpn1TrVp4aKLGn=-w@mail.gmail.com>
Date: Mon, 14 Apr 2025 21:45:42 +0200
From: Ard Biesheuvel <ardb@...nel.org>
To: Tom Lendacky <thomas.lendacky@....com>
Cc: Ard Biesheuvel <ardb+git@...gle.com>, linux-efi@...r.kernel.org, x86@...nel.org, 
	linux-kernel@...r.kernel.org, mingo@...nel.org, 
	Borislav Petkov <bp@...en8.de>, Dionna Amalie Glaze <dionnaglaze@...gle.com>, 
	Kevin Loughlin <kevinloughlin@...gle.com>
Subject: Re: [RFC/RFT PATCH] x86/efistub: Don't bother enabling SEV in the EFI stub

Hi Tom,

Thanks for taking a look.


On Mon, 14 Apr 2025 at 21:10, Tom Lendacky <thomas.lendacky@....com> wrote:
>
> On 4/14/25 08:04, Ard Biesheuvel wrote:
> > From: Ard Biesheuvel <ardb@...nel.org>
> >
> > One of the last things the EFI stub does before handing over to the core
> > kernel when booting as a SEV guest is enabling SEV, even though this is
> > mostly redundant: one of the first things the core kernel does is
> > calling sme_enable(), after setting up the early GDT and IDT but before
> > even setting up the kernel page tables.
> >
> > So let's just drop this call to sev_enable(), and rely on the core
> > kernel to initiaize SEV correctly.
>
> SEV support does some things in sev_enable() that aren't done later in
> the kernel proper. For example, we check certain hypervisor features and
> save the CC blob into the boot parameters.

I misread the last part: the kernel proper checks struct boot_params
and setup_data, whereas the decompressor checks both of those as well
as the EFI config table.

It would make sense for the EFI stub to populate the field in struct
boot_params directly.

> And as I look closer, I see
> that we don't call initialize_identity_maps() from the EFI stub so we
> aren't calling snp_check_features() from the EFI stub, which we should
> have been doing.
>

The EFI stub has its own check for this, based on the same underlying
logic (have_unsupported_snp_features()). But it checks this much
earlier so it can fail gracefully and return to the firmware, rather
than terminate.

> Just removing the call does cause an SNP boot to crash. My testing shows
> just ensuring that the cc_blob_address in the boot_params structure is
> set results in a successful boot under SNP. So some of sev_enable()
> needs to remain and some things need to be moved into the kernel proper.
>

Thanks, this is very helpful. I'll dig a bit deeper and try to address
the points you raised.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ