public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: devel@edk2.groups.io, kraxel@redhat.com
Cc: Jiewen Yao <jiewen.yao@intel.com>, Min Xu <min.m.xu@intel.com>,
	Tom Lendacky <thomas.lendacky@amd.com>,
	Oliver Steffen <osteffen@redhat.com>,
	Erdem Aktas <erdemaktas@google.com>,
	Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Michael Roth <michael.roth@amd.com>
Subject: Re: [edk2-devel] [PATCH v2 12/12] OvmfPkg: only add shell to FV in case secure boot is disabled
Date: Fri, 16 Feb 2024 18:56:43 +0100	[thread overview]
Message-ID: <781606c6-b15e-525b-7deb-364af8c1fc9c@redhat.com> (raw)
In-Reply-To: <20240215102503.273275-13-kraxel@redhat.com>

On 2/15/24 11:25, Gerd Hoffmann wrote:
> The EFI Shell allows to bypass secure boot, do not allow
> to include the shell in the firmware images of secure boot
> enabled builds.
>
> This prevents misconfigured downstream builds.
>
> Ref: https://bugs.launchpad.net/ubuntu/+source/edk2/+bug/2040137
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4641
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  OvmfPkg/Include/Fdf/ShellDxe.fdf.inc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/OvmfPkg/Include/Fdf/ShellDxe.fdf.inc b/OvmfPkg/Include/Fdf/ShellDxe.fdf.inc
> index 3081ac41780a..38f69747b02c 100644
> --- a/OvmfPkg/Include/Fdf/ShellDxe.fdf.inc
> +++ b/OvmfPkg/Include/Fdf/ShellDxe.fdf.inc
> @@ -2,7 +2,7 @@
>  #    SPDX-License-Identifier: BSD-2-Clause-Patent
>  ##
>
> -!if $(BUILD_SHELL) == TRUE
> +!if $(BUILD_SHELL) == TRUE && $(SECURE_BOOT_ENABLE) == FALSE
>
>  !if $(TOOL_CHAIN_TAG) != "XCODE5"
>  !if $(NETWORK_ENABLE) == TRUE

This does the job:

Reviewed-by: Laszlo Ersek <lersek@redhat.com>

An alternative could be (perhaps informing the user better):

  !if $(BUILD_SHELL) == TRUE
  !if $(SECURE_BOOT_ENABLE) == TRUE
  !error BUILD_SHELL and SECURE_BOOT_ENABLE conflict
  !endif
  ...
  !endif

If you prefer that approach, feel free to submit a v3 (you can add my
R-b for that variant immediately).

A disadvantage might be that, with such a patch in place, people having
built OVMF with "-D SECURE_BOOT_ENABLE" thus far would start getting
build failures, and they'd have to explicitly pass "-D
BUILD_SHELL=FALSE", IIUC.

(Well, some might consider such a build failure an advantage actually:
near the BUILD_SHELL define, we have a comment saying "Shell can be
useful for debugging but should not be enabled for production". Pick
your poison, I guess...)

A repost might be worth your while either way, because some of the
patches are identical to their first versions, and Jiewen's v1 Acked-by,
from [1], is missing from the unchanged (or trivially rebased) patches
in v2.

I strongly prefer capturing all feedback tags in the git history; after
all, that keeps a record of reviewer *work* (not just the mere approval
itself).

[1] https://edk2.groups.io/g/devel/message/114362
    msgid <MW4PR11MB5872132F77F29DC6758C71178C7A2@MW4PR11MB5872.namprd11.prod.outlook.com>

Thanks,
Laszlo



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115551): https://edk2.groups.io/g/devel/message/115551
Mute This Topic: https://groups.io/mt/104370218/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2024-02-16 17:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-15 10:24 [edk2-devel] [PATCH v2 00/12] OvmfPkg: tweak shell builds Gerd Hoffmann
2024-02-15 10:24 ` [edk2-devel] [PATCH v2 01/12] OvmfPkg: add ShellComponents.dsc.inc Gerd Hoffmann
2024-02-15 10:24 ` [edk2-devel] [PATCH v2 02/12] OvmfPkg: add ShellLibs.dsc.inc Gerd Hoffmann
2024-02-16 17:29   ` Laszlo Ersek
2024-02-15 10:24 ` [edk2-devel] [PATCH v2 03/12] OvmfPkg: add ShellDxe.fdf.inc Gerd Hoffmann
2024-02-15 10:24 ` [edk2-devel] [PATCH v2 04/12] OvmfPkg: Shell*.inc: allow building without network support Gerd Hoffmann
2024-02-16 17:34   ` Laszlo Ersek
2024-02-15 10:24 ` [edk2-devel] [PATCH v2 05/12] OvmfPkg: ShellDxe.fdf.inc: add VariablePolicyDynamicCommand to FV Gerd Hoffmann
2024-02-15 10:24 ` [edk2-devel] [PATCH v2 06/12] OvmfPkg: switch OvmfPkgIa32 to new shell include files Gerd Hoffmann
2024-02-15 10:24 ` [edk2-devel] [PATCH v2 07/12] OvmfPkg: switch OvmfPkgIa32X64 " Gerd Hoffmann
2024-02-15 10:24 ` [edk2-devel] [PATCH v2 08/12] OvmfPkg: switch AmdSevX64 " Gerd Hoffmann
2024-02-16 17:38   ` Laszlo Ersek
2024-02-15 10:25 ` [edk2-devel] [PATCH v2 09/12] OvmfPkg: switch IntelTdxX64 " Gerd Hoffmann
2024-02-16 17:40   ` Laszlo Ersek
2024-02-15 10:25 ` [edk2-devel] [PATCH v2 10/12] OvmfPkg: switch MicrovmX64 " Gerd Hoffmann
2024-02-15 10:25 ` [edk2-devel] [PATCH v2 11/12] OvmfPkg/CI: copy shell to virtual drive Gerd Hoffmann
2024-02-16 17:42   ` Laszlo Ersek
2024-02-15 10:25 ` [edk2-devel] [PATCH v2 12/12] OvmfPkg: only add shell to FV in case secure boot is disabled Gerd Hoffmann
2024-02-16 17:56   ` Laszlo Ersek [this message]
2024-02-19 10:21     ` Gerd Hoffmann
2024-02-19 20:06       ` Laszlo Ersek

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=781606c6-b15e-525b-7deb-364af8c1fc9c@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