From nobody Sun Feb 8 22:35:02 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+84230+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+84230+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1638387067; cv=none; d=zohomail.com; s=zohoarc; b=mMwvK5eMgeaVPlorxnNlnc5WwHK2v4Na7V5XDR6xztCtZFUBodA0FWEaKdyJ7XLIJSsgojKJs8oFHyxRPROMYFLxXccjFdpezKmsCS6oENnEL7nlZwD/K4TF+PSi/XHD471BuZJnUuip1ulmyhLTssEuiZhSsmNzf1WGoTShHdQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1638387067; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=kmADZY+J0sZjdnc/PxlPfIRlnLV85vr5tB1mKHzxiMU=; b=Xr1TV6OvJ9XB4Ak9JSVw8LBqqfowVjNnTTGHH8pJ/fh3Vq19SxycdksNPxTcYBqZSp98Z6Gq68askK+dmd2+yZto1KdzLC/zAyKS1oxVY6TarEMCwGO9YF1b7dHMGv+mVSOHDgsd58u//6ExEBcYDnKFIWhlLsl1cenkkdDjN0U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+84230+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1638387067987643.6452901204444; Wed, 1 Dec 2021 11:31:07 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id YgMTYY1788612xR66pZFkClG; Wed, 01 Dec 2021 11:31:07 -0800 X-Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by mx.groups.io with SMTP id smtpd.web12.1729.1638387067038695118 for ; Wed, 01 Dec 2021 11:31:07 -0800 X-Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1B1IlWLt023872 for ; Wed, 1 Dec 2021 19:31:06 GMT X-Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3cpen0rtdd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 01 Dec 2021 19:31:06 +0000 X-Received: from m0098393.ppops.net (m0098393.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 1B1J93BS023423 for ; Wed, 1 Dec 2021 19:31:05 GMT X-Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0a-001b2d01.pphosted.com with ESMTP id 3cpen0rt98-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 01 Dec 2021 19:31:05 +0000 X-Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1B1JD3Fv026132; Wed, 1 Dec 2021 19:30:48 GMT X-Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by ppma03dal.us.ibm.com with ESMTP id 3ckcackmnb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 01 Dec 2021 19:30:48 +0000 X-Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1B1JUlnt18809222 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 1 Dec 2021 19:30:47 GMT X-Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EE0376E05D; Wed, 1 Dec 2021 19:30:46 +0000 (GMT) X-Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 48F5E6E053; Wed, 1 Dec 2021 19:30:46 +0000 (GMT) X-Received: from sbct-2.pok.ibm.com (unknown [9.47.158.152]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 1 Dec 2021 19:30:46 +0000 (GMT) From: "Stefan Berger" To: devel@edk2.groups.io, kraxel@redhat.com, marcandre.lureau@redhat.com Cc: Stefan Berger Subject: [edk2-devel] [PATCH v3 4/8] SecurityPkg: Declare PhysicalPresenceFlags variable and its properties Date: Wed, 1 Dec 2021 14:30:26 -0500 Message-Id: <20211201193030.3932074-5-stefanb@linux.ibm.com> In-Reply-To: <20211201193030.3932074-1-stefanb@linux.ibm.com> References: <20211201193030.3932074-1-stefanb@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: YHIcgl-sOmVxWlsyfJ4w-1qfOWAQxVsI X-Proofpoint-ORIG-GUID: DHFcVbNgvMbWnkPGO2rAiDTlV0XQdgzs Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,stefanb@linux.ibm.com X-Gm-Message-State: 24C42SBUHMZ6qaVvagPr9Ffjx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1638387067; bh=TuHjpnnmrgEDiW18KU0PNOQ2ZmJrH5bPTsE28k5ud7Q=; h=Cc:Date:From:Reply-To:Subject:To; b=RTEnz92q9HIatc+D6+c3DAZOCiZEP9CRiOJvHcYVqgRrJOdkrPXaOSp5mhTGVPXNxuP k+POHE6Qhx1D9Bjv8ESKtYMEfZz9CukpHkxj7zy9ulp/7F0EuVnEgzeizDKaDvS3kpEOd Bgi1Ei7z1RQdciyQvZr+HxDUT+h1WOYDdhw= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1638387068718100006 Content-Type: text/plain; charset="utf-8" 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 --- .../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/Se= curityPkg/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 =20 #include #include +#include =20 #define TWO_BYTE_ENCODE 0x82 =20 diff --git a/SecurityPkg/Library/AuthVariableLib/AuthVariableLib.c b/Securi= tyPkg/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[] =3D { 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 + } + } }; =20 VOID **mAuthVarAddressPointer[9]; diff --git a/SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf b/Secu= rityPkg/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 =20 + ## CONSUMES ## Variable:L"PhysicalPresenceFlags" + ## PRODUCES ## Variable:L"PhysicalPresenceFlags" + gEfiPhysicalPresenceGuid + ## CONSUMES ## Variable:L"VendorKeysNv" ## PRODUCES ## Variable:L"VendorKeysNv" gEfiVendorKeysNvGuid --=20 2.31.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84230): https://edk2.groups.io/g/devel/message/84230 Mute This Topic: https://groups.io/mt/87436455/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-