public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: "Park, Kyung Min" <kyung.min.park@intel.com>
Cc: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: Secureboot enable with OVMF
Date: Thu, 13 Dec 2018 11:49:06 +0100	[thread overview]
Message-ID: <8ccd187d-cffb-ef30-2be9-e48f32a85fec@redhat.com> (raw)
In-Reply-To: <3658BA65DD26AF4BA909BEB2C6DF6181962783D2@ORSMSX102.amr.corp.intel.com>

On 12/13/18 02:25, Park, Kyung Min wrote:
> Hi,
> 
> I'm trying to enable the secureboot with OVMF. I followed the steps as below.
> But When I executed LockDown.efi, it gives me an error which says, "Failed to enroll PK: 26".
> According to UEFI spec, the 26 means EFI_SECURITY_VIOLATION, but I don't understand why I got this error.
> Before I ran the LockDown.efi, the secureboot was disabled by default and the PK key was not enrolled.
> 
> 1. Build OVMF with secureboot enable
> https://wiki.ubuntu.com/UEFI/EDK2

Please know that, if you build OVMF with *just* SECURE_BOOT_ENABLE, but
without SMM_REQUIRE, then a malicious guest OS may modify the pflash
chip with direct hardware access that contains the authenticated UEFI
variables. In other words, a malicious guest OS may circumvent Secure Boot.

If that's OK for your use case (it could be), then it's OK to use just
SECURE_BOOT_ENABLE; but it should be a conscious decision.

Regarding SMM_REQUIRE, please see OvmfPkg/README, section "SMM support".

> 2. Generate/Execute LockDown.efi to enroll PK/KEK/DB keys
> git://git.kernel.org/pub/scm/linux/kernel/git/jejb/efitools.git
> 
> I would appreciate any useful information about this error.

You'll have to dig into LockDown.efi for that. If you are convinced
LockDown.efi does the right thing, then you'll have to add debug
messages to the edk2 stack that handles authenticated variables (the
variable driver, some SecurityPkg / CryptoPkg libraries, etc). This is
usually quite time consuming.

As an alternative, you might be able to use
"/usr/share/edk2/ovmf/EnrollDefaultKeys.efi", from the "edk2-ovmf"
subpackage package, from

  https://koji.fedoraproject.org/koji/packageinfo?packageID=16183

(You can find the source code in the SRPM.)

Thanks,
Laszlo


  reply	other threads:[~2018-12-13 10:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-13  1:25 Secureboot enable with OVMF Park, Kyung Min
2018-12-13 10:49 ` Laszlo Ersek [this message]
2018-12-16 21:49   ` Park, Kyung Min

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8ccd187d-cffb-ef30-2be9-e48f32a85fec@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox