public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: devel@edk2.groups.io, michael.kubacki@outlook.com
Cc: Jordan Justen <jordan.l.justen@intel.com>,
	Ard Biesheuvel <ard.biesheuvel@arm.com>,
	Anthony Perard <anthony.perard@citrix.com>,
	Julien Grall <julien@xen.org>
Subject: Re: [edk2-devel] [PATCH v2 11/12] OvmfPkg: Add VariablePolicy engine to OvmfPkg platform
Date: Tue, 12 May 2020 14:05:35 +0200	[thread overview]
Message-ID: <a0e0e3d4-6712-078a-4d95-29408109b0b0@redhat.com> (raw)
In-Reply-To: <MWHPR07MB3440D2FEDF161F0255247529E9BE0@MWHPR07MB3440.namprd07.prod.outlook.com>

On 05/12/20 08:46, Michael Kubacki wrote:
> From: Bret Barkelew <brbarkel@microsoft.com>
>
> https://bugzilla.tianocore.org/show_bug.cgi?id=2522
>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
> ---
>  OvmfPkg/OvmfPkgIa32.dsc    | 8 ++++++++
>  OvmfPkg/OvmfPkgIa32X64.dsc | 8 ++++++++
>  OvmfPkg/OvmfPkgX64.dsc     | 8 ++++++++
>  3 files changed, 24 insertions(+)

(1) Repeating my request from under the blurb, please cover
"OvmfXen.dsc" too.

>
> diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
> index 41ac3202961b..7c7b33a8bec3 100644
> --- a/OvmfPkg/OvmfPkgIa32.dsc
> +++ b/OvmfPkg/OvmfPkgIa32.dsc
> @@ -3,6 +3,7 @@
>  #
>  #  Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
>  #  (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
> +#  Copyright (c) Microsoft Corporation.
>  #
>  #  SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
> @@ -196,6 +197,8 @@
>    AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
>  !endif
>    VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
> +  VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf
> +  VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf
>
>
>    #
> @@ -334,6 +337,7 @@
>    BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
>    PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf
>    QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf
> +  VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLibRuntimeDxe.inf
>
>  [LibraryClasses.common.UEFI_DRIVER]
>    PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
> @@ -492,6 +496,9 @@
>    gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVolatileVariableSize|0x40000
>  !endif
>
> +  # Optional: Omit if VariablePolicy should be always-on.
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdAllowVariablePolicyEnforcementDisable|TRUE
> +
>    gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress|0x0
>
>    gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x07

(2) Based on the wiki article section here (which I find very useful):

  https://github.com/tianocore/tianocore.github.io/wiki/VariablePolicy-Protocol---Enhanced-Method-for-Managing-Variables#pcdallowvariablepolicyenforcementdisable

I'd like us to drop this hunk. The default should be secure.

Now, I realize that people might want to set this PCD to TRUE in OVMF,
for testing various things. Maybe the unit tests / functional tests
introduced in this series even *depend* on the PCD being TRUE (I can't
tell, I haven't checked). That's OK; for accommodating that, we have two
options:

(2a) build OVMF with the appropriate --pcd=... switch passed to "build",

(2b) for controlling the PCD dynamically (on the QEMU command line):

- the PCD would have permit the dynamic access method in the DEC file,

- the modules consuming the PCD would have to do so in their entry point
  functions / library constructors, and use the cached copy thenceforth,

- the OVMF DSC files would have to get a dynamic default (value FALSE),

- and OVMF would need another NULL class library for setting the PCD
  from fw_cfg. Please refer to
  <https://bugzilla.tianocore.org/show_bug.cgi?id=2681> for details on
  that.

The patch looks OK to me otherwise.

Thanks!
Laszlo

> @@ -945,6 +952,7 @@
>    MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf {
>      <LibraryClasses>
>        NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
> +      NULL|MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.inf
>    }
>    MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf
>
> diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
> index c2f11aee2cec..8d5c6b3fc4b6 100644
> --- a/OvmfPkg/OvmfPkgIa32X64.dsc
> +++ b/OvmfPkg/OvmfPkgIa32X64.dsc
> @@ -3,6 +3,7 @@
>  #
>  #  Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
>  #  (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
> +#  Copyright (c) Microsoft Corporation.
>  #
>  #  SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
> @@ -200,6 +201,8 @@
>    AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
>  !endif
>    VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
> +  VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf
> +  VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf
>
>
>    #
> @@ -338,6 +341,7 @@
>    BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
>    PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf
>    QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf
> +  VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLibRuntimeDxe.inf
>
>  [LibraryClasses.common.UEFI_DRIVER]
>    PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
> @@ -496,6 +500,9 @@
>    gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVolatileVariableSize|0x40000
>  !endif
>
> +  # Optional: Omit if VariablePolicy should be always-on.
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdAllowVariablePolicyEnforcementDisable|TRUE
> +
>    gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress|0x0
>
>    gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x07
> @@ -959,6 +966,7 @@
>    MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf {
>      <LibraryClasses>
>        NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
> +      NULL|MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.inf
>    }
>    MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf
>
> diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
> index 643e6041ad53..960d43eb1e84 100644
> --- a/OvmfPkg/OvmfPkgX64.dsc
> +++ b/OvmfPkg/OvmfPkgX64.dsc
> @@ -3,6 +3,7 @@
>  #
>  #  Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
>  #  (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
> +#  Copyright (c) Microsoft Corporation.
>  #
>  #  SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
> @@ -200,6 +201,8 @@
>    AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
>  !endif
>    VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
> +  VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf
> +  VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf
>
>
>    #
> @@ -338,6 +341,7 @@
>    BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
>    PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf
>    QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf
> +  VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLibRuntimeDxe.inf
>
>  [LibraryClasses.common.UEFI_DRIVER]
>    PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
> @@ -496,6 +500,9 @@
>    gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVolatileVariableSize|0x40000
>  !endif
>
> +  # Optional: Omit if VariablePolicy should be always-on.
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdAllowVariablePolicyEnforcementDisable|TRUE
> +
>    gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress|0x0
>
>    gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x07
> @@ -956,6 +963,7 @@
>    MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf {
>      <LibraryClasses>
>        NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
> +      NULL|MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.inf
>    }
>    MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf
>
>


  reply	other threads:[~2020-05-12 12:05 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200512064635.14640-1-michael.kubacki@outlook.com>
2020-05-12  6:46 ` [PATCH v2 01/12] MdeModulePkg: Define the VariablePolicy protocol interface Michael Kubacki
2020-05-12 12:19   ` [edk2-devel] " Laszlo Ersek
2020-05-13  4:51     ` [EXTERNAL] " Bret Barkelew
2020-05-13 10:10       ` Laszlo Ersek
2020-05-12  6:46 ` [PATCH v2 02/12] MdeModulePkg: Define the VariablePolicyLib Michael Kubacki
2020-05-12 11:43   ` [edk2-devel] " Laszlo Ersek
2020-05-12  6:46 ` [PATCH v2 03/12] MdeModulePkg: Define the VariablePolicyHelperLib Michael Kubacki
2020-05-12  6:46 ` [PATCH v2 04/12] MdeModulePkg: Define the VarCheckPolicyLib and SMM interface Michael Kubacki
2020-05-12 12:26   ` [edk2-devel] " Laszlo Ersek
2020-05-12 13:37     ` Liming Gao
2020-05-12  6:46 ` [PATCH v2 05/12] MdeModulePkg: Connect VariablePolicy business logic to VariableServices Michael Kubacki
2020-05-12  6:46 ` [PATCH v2 06/12] MdeModulePkg: Allow VariablePolicy state to delete protected variables Michael Kubacki
2020-05-12  6:46 ` [PATCH v2 07/12] SecurityPkg: Allow VariablePolicy state to delete authenticated variables Michael Kubacki
2020-05-12  6:46 ` [PATCH v2 08/12] MdeModulePkg: Change TCG MOR variables to use VariablePolicy Michael Kubacki
2020-05-12  6:46 ` [PATCH v2 09/12] MdeModulePkg: Drop VarLock from RuntimeDxe variable driver Michael Kubacki
2020-05-12  6:46 ` [PATCH v2 10/12] MdeModulePkg: Add a shell-based functional test for VariablePolicy Michael Kubacki
2020-05-12  6:46 ` [PATCH v2 11/12] OvmfPkg: Add VariablePolicy engine to OvmfPkg platform Michael Kubacki
2020-05-12 12:05   ` Laszlo Ersek [this message]
2020-05-12  6:46 ` [PATCH v2 12/12] EmulatorPkg: Add VariablePolicy engine to EmulatorPkg platform Michael Kubacki

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=a0e0e3d4-6712-078a-4d95-29408109b0b0@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