public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Stefan Berger" <stefanb@linux.ibm.com>
To: devel@edk2.groups.io, kraxel@redhat.com, marcandre.lureau@redhat.com
Cc: Stefan Berger <stefanb@linux.ibm.com>
Subject: [PATCH v3 4/8] SecurityPkg: Declare PhysicalPresenceFlags variable and its properties
Date: Wed,  1 Dec 2021 14:30:26 -0500	[thread overview]
Message-ID: <20211201193030.3932074-5-stefanb@linux.ibm.com> (raw)
In-Reply-To: <20211201193030.3932074-1-stefanb@linux.ibm.com>

Declare the TPM 1.2 PhysicalPresenceFlags variable and its properties.

The effect of its properties is that once PhysicalPresenceFlags is
defined it cannot be deleted from Linux:

cd /sys/firmware/efi/efivars
chattr -i PhysicalPresenceFlags-*
rm -f PhysicalPresenceFlags-*

It will still be there:

ls PhysicalPresenceFlags-*

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
---
 .../Library/AuthVariableLib/AuthServiceInternal.h     |  1 +
 SecurityPkg/Library/AuthVariableLib/AuthVariableLib.c | 11 +++++++++++
 .../Library/AuthVariableLib/AuthVariableLib.inf       |  4 ++++
 3 files changed, 16 insertions(+)

diff --git a/SecurityPkg/Library/AuthVariableLib/AuthServiceInternal.h b/SecurityPkg/Library/AuthVariableLib/AuthServiceInternal.h
index 2bec637f75..fc2abdb96c 100644
--- a/SecurityPkg/Library/AuthVariableLib/AuthServiceInternal.h
+++ b/SecurityPkg/Library/AuthVariableLib/AuthServiceInternal.h
@@ -30,6 +30,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 
 #include <Guid/AuthenticatedVariableFormat.h>
 #include <Guid/ImageAuthentication.h>
+#include <Guid/PhysicalPresenceData.h>
 
 #define TWO_BYTE_ENCODE       0x82
 
diff --git a/SecurityPkg/Library/AuthVariableLib/AuthVariableLib.c b/SecurityPkg/Library/AuthVariableLib/AuthVariableLib.c
index 122b3b0bf4..ae75f32d40 100644
--- a/SecurityPkg/Library/AuthVariableLib/AuthVariableLib.c
+++ b/SecurityPkg/Library/AuthVariableLib/AuthVariableLib.c
@@ -89,6 +89,17 @@ VARIABLE_ENTRY_PROPERTY mAuthVarEntry[] = {
       MAX_UINTN
     }
   },
+  {
+    &gEfiPhysicalPresenceGuid,
+    PHYSICAL_PRESENCE_FLAGS_VARIABLE,
+    {
+      VAR_CHECK_VARIABLE_PROPERTY_REVISION,
+      VAR_CHECK_VARIABLE_PROPERTY_READ_ONLY,
+      VARIABLE_ATTRIBUTE_NV_BS,
+      sizeof (EFI_PHYSICAL_PRESENCE_FLAGS),
+      MAX_UINTN
+    }
+  }
 };
 
 VOID **mAuthVarAddressPointer[9];
diff --git a/SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf b/SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf
index 8eadeebceb..d0ced0792c 100644
--- a/SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf
+++ b/SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf
@@ -75,6 +75,10 @@
   ## PRODUCES            ## Variable:L"certdbv"
   gEfiCertDbGuid
 
+  ## CONSUMES            ## Variable:L"PhysicalPresenceFlags"
+  ## PRODUCES            ## Variable:L"PhysicalPresenceFlags"
+  gEfiPhysicalPresenceGuid
+
   ## CONSUMES            ## Variable:L"VendorKeysNv"
   ## PRODUCES            ## Variable:L"VendorKeysNv"
   gEfiVendorKeysNvGuid
-- 
2.31.1


  parent reply	other threads:[~2021-12-01 19:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-01 19:30 [PATCH v3 0/8] Add support for TPM 1.2 Physical Presence Interface and Menu Stefan Berger
2021-12-01 19:30 ` [PATCH v3 1/8] OvmfPkg: Move processing of physical presence opcode before End-of-Dxe Stefan Berger
2021-12-01 19:30 ` [PATCH v3 2/8] OvmfPkg: Check for TPM 2 early to leave function early Stefan Berger
2021-12-01 19:30 ` [PATCH v3 3/8] SecurityPkg: Store physical presence code by submitting to PreOS func Stefan Berger
2021-12-01 19:30 ` Stefan Berger [this message]
2021-12-01 19:30 ` [PATCH v3 5/8] OvmfPkg: Copy TPM 1.2 DxeTcgPhysicalPresenceLib.c from SecurityPkg Stefan Berger
2021-12-01 19:30 ` [PATCH v3 6/8] OvmfPkg: Enable physical presence interface for TPM 1.2 Stefan Berger
2021-12-01 19:30 ` [PATCH v3 7/8] OvmfPkg: Enable TPM 1.2 Physical Presence Opcode processing Stefan Berger
2021-12-01 19:30 ` [PATCH v3 8/8] OvmfPkg: add TPM 1.2 config menu Stefan Berger

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=20211201193030.3932074-5-stefanb@linux.ibm.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