From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by mx.groups.io with SMTP id smtpd.web11.10766.1631105210723391674 for ; Wed, 08 Sep 2021 05:46:51 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@ibm.com header.s=pp1 header.b=bFQ8TF9a; spf=none, err=permanent DNS error (domain: linux.vnet.ibm.com, ip: 148.163.156.1, mailfrom: stefanb@linux.vnet.ibm.com) Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 188CY1SM054553; Wed, 8 Sep 2021 08:46:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : mime-version; s=pp1; bh=jMgepS5cI26gy9Q5loP/Rb6G4QMJUepHv3iQHK/uNB8=; b=bFQ8TF9aSf6gTGdTljYdGnZEa6wiqaxnZlqmbL4IrfQH60zCNcG1OTX5jOMJnhZ1erg7 QoVlmoMXe9ZFCkYtjCboYXt/C1NJvIuyRh6XA7eRCOvxbXW+mS+rD6uBXWofxCSAI9W3 3C57R/Hz+Y7u1CgsN7Dcvs3MKrfbBBiFM9boYFkph8mXNAuDkTqpylrwGyeFsBnHuDvd 1hr45vm0eXCx1FeGFRhFey7WUdNhTRSYapTyAp/vfdRow6EYE0EYGO9BQwOG9NLvQrv1 7QFBCmjvfZZL3e3va7fs3Fd0jA5VPEA9JXCXuNERyFAPCPig01MIs7PpmuVizBDfiL6n eA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3axp74tk73-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Sep 2021 08:46:49 -0400 Received: from m0098394.ppops.net (m0098394.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 188CYwU6059006; Wed, 8 Sep 2021 08:46:49 -0400 Received: from ppma01wdc.us.ibm.com (fd.55.37a9.ip4.static.sl-reverse.com [169.55.85.253]) by mx0a-001b2d01.pphosted.com with ESMTP id 3axp74tk6j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Sep 2021 08:46:49 -0400 Received: from pps.filterd (ppma01wdc.us.ibm.com [127.0.0.1]) by ppma01wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 188CfxIt018374; Wed, 8 Sep 2021 12:46:48 GMT Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by ppma01wdc.us.ibm.com with ESMTP id 3axcnn1sy1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Sep 2021 12:46:48 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 188CklcE31785434 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 8 Sep 2021 12:46:47 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 629BD112070; Wed, 8 Sep 2021 12:46:47 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5DD8E112064; Wed, 8 Sep 2021 12:46:47 +0000 (GMT) Received: from sbct-2.pok.ibm.com (unknown [9.47.158.152]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP; Wed, 8 Sep 2021 12:46:47 +0000 (GMT) From: Stefan Berger To: devel@edk2.groups.io Cc: mhaeuser@posteo.de, spbrogan@outlook.com, marcandre.lureau@redhat.com, kraxel@redhat.com, jiewen.yao@intel.com, Stefan Berger Subject: [PATCH v6 0/9] Ovmf: Disable the TPM2 platform hierarchy Date: Wed, 8 Sep 2021 08:46:35 -0400 Message-Id: <20210908124644.816856-1-stefanb@linux.vnet.ibm.com> X-Mailer: git-send-email 2.31.1 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: RoDNnP3ygJTxF2Q512qYNteLSkDXOq2l X-Proofpoint-ORIG-GUID: ueVOzwpmidvvr1hjns1r8jpE56sC_1Oi X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-09-08_06:2021-09-07,2021-09-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 phishscore=0 adultscore=0 priorityscore=1501 suspectscore=0 mlxlogscore=999 mlxscore=0 spamscore=0 lowpriorityscore=0 bulkscore=0 malwarescore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109030001 definitions=main-2109080080 Content-Transfer-Encoding: 8bit This series imports code from the edk2-platforms project related to disabling the TPM2 platform hierarchy in Ovmf and ArmVirtPkg. It addresses the Ovmf aspects of the following bugs: https://bugzilla.tianocore.org/show_bug.cgi?id=3510 https://bugzilla.tianocore.org/show_bug.cgi?id=3499 I have patched the .dsc files and successfully test-built with most of them. Some I could not build because they failed for other reasons unrelated to this series. I tested the changes with QEMU on x86 following the build of ArmVirtQemu.dsc and OvmfPkgX64.dsc. The disablement of the platform hierarchy is done after possibly handling PPI. Following TPM 2 logs on Arm, only PCR extensions are following afterwards until GRUB takes over. Neither one of the following commands should work anymore on first try: With IBM tss2 tools: tsshierarchychangeauth -hi p -pwdn newpass With Intel tss2 tools: tpm2_changeauth -c platform newpass Regards, Stefan v6: - Removed unnecessary entries in .dsc files - Added support for S3 resume failure case - Assigned unique FILE_GUID to NULL implementation v5: - Modified patch 1 copies the code from edk2-platforms - Modified patch 2 fixes bugs in the code - Modified patch 4 introduces required PCD v4: - Fixed and simplified code imported from edk2-platforms v3: - Referencing Null implementation on Bhyve and Xen platforms - Add support in ArmVirtPkg Stefan Berger (9): SecurityPkg/TPM: Import PeiDxeTpmPlatformHierarchyLib.c from edk2-platforms SecurityPkg/TPM: Fix bugs in imported PeiDxeTpmPlatformHierarchyLib SecurityPkg/TPM: Add a NULL implementation of TpmPlatformHierarchyLib SecurityPkg: Introduce new PCD PcdRandomizePlatformHierarchy OvmfPkg: Reference new TPM classes in the build system for compilation OvmfPkg: Disable the TPM2 platform hierarchy SecurityPkg: Disable TPM platform hierarchy if TPM resume fails (S3 resume) ArmVirtPkg: Reference new TPM classes in the build system for compilation ArmVirtPkg: Disable the TPM2 platform hierarchy ArmVirtPkg/ArmVirtCloudHv.dsc | 1 + ArmVirtPkg/ArmVirtQemu.dsc | 2 + ArmVirtPkg/ArmVirtQemuKernel.dsc | 1 + ArmVirtPkg/ArmVirtXen.dsc | 1 + .../PlatformBootManagerLib/PlatformBm.c | 6 + .../PlatformBootManagerLib.inf | 2 + OvmfPkg/AmdSev/AmdSevX64.dsc | 2 + OvmfPkg/Bhyve/BhyveX64.dsc | 1 + .../PlatformBootManagerLib/BdsPlatform.c | 6 + .../PlatformBootManagerLib.inf | 1 + .../PlatformBootManagerLibBhyve/BdsPlatform.c | 6 + .../PlatformBootManagerLibGrub/BdsPlatform.c | 6 + OvmfPkg/OvmfPkgIa32.dsc | 2 + OvmfPkg/OvmfPkgIa32X64.dsc | 2 + OvmfPkg/OvmfPkgX64.dsc | 2 + OvmfPkg/OvmfXen.dsc | 1 + .../Include/Library/TpmPlatformHierarchyLib.h | 27 ++ .../PeiDxeTpmPlatformHierarchyLib.c | 255 ++++++++++++++++++ .../PeiDxeTpmPlatformHierarchyLib.inf | 44 +++ .../PeiDxeTpmPlatformHierarchyLib.c | 19 ++ .../PeiDxeTpmPlatformHierarchyLib.inf | 31 +++ SecurityPkg/SecurityPkg.dec | 6 + SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c | 2 + SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf | 1 + 24 files changed, 427 insertions(+) create mode 100644 SecurityPkg/Include/Library/TpmPlatformHierarchyLib.h create mode 100644 SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.c create mode 100644 SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.inf create mode 100644 SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.c create mode 100644 SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.inf -- 2.31.1