From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.158.5]) by mx.groups.io with SMTP id smtpd.web08.2481.1631208942583315694 for ; Thu, 09 Sep 2021 10:35:43 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@ibm.com header.s=pp1 header.b=F3mY1Vs+; spf=none, err=permanent DNS error (domain: linux.vnet.ibm.com, ip: 148.163.158.5, mailfrom: stefanb@linux.vnet.ibm.com) Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 189HXKGl162867; Thu, 9 Sep 2021 13:35:41 -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=tLpRkbGqyUCJN6FHhFaku8TrhES2KvDavpHiAniyrq4=; b=F3mY1Vs+MZLF7YlxW46x4mLUCEoI6Vz2Nprw5Tzqw0mHCUcYWLCo9A7GErXgGe//zW6P p/vy6dZhYrO2RFmCFrqs8ulbyQlXybhY4mBMFtkhw/za6dpHhY5Btzds7clYHoej/+Mk awnZyv3ZsKCkoeMIWfVhnmlXc3FIUAQmw781Rmp4ohvp9rRXqhE/LANh8V7gAmlRVxaO 9AwXctv7Bj8xyaxfspGsR8Jzh2pfWqVSAMhu5w8TcBWLzRtMqN5/2PcmldL6qBGMO5r7 e9WLcB+PbsAbuCChqbc2UYb3sQF3u7iHbcFOhVzRbQIqvMnaMM24CO1JXtiBSpr7iL3J Lg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 3aypq5057t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Sep 2021 13:35:41 -0400 Received: from m0098413.ppops.net (m0098413.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 189HZTPI172935; Thu, 9 Sep 2021 13:35:41 -0400 Received: from ppma05wdc.us.ibm.com (1b.90.2fa9.ip4.static.sl-reverse.com [169.47.144.27]) by mx0b-001b2d01.pphosted.com with ESMTP id 3aypq5057j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Sep 2021 13:35:40 -0400 Received: from pps.filterd (ppma05wdc.us.ibm.com [127.0.0.1]) by ppma05wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 189HNRI9003425; Thu, 9 Sep 2021 17:35:40 GMT Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by ppma05wdc.us.ibm.com with ESMTP id 3axcnpjxg3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Sep 2021 17:35:40 +0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 189HZdwi42271182 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 9 Sep 2021 17:35:39 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 73593AC062; Thu, 9 Sep 2021 17:35:39 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5A53DAC05F; Thu, 9 Sep 2021 17:35:39 +0000 (GMT) Received: from sbct-2.pok.ibm.com (unknown [9.47.158.152]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 9 Sep 2021 17:35:39 +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 v7 0/9] Ovmf: Disable the TPM2 platform hierarchy Date: Thu, 9 Sep 2021 13:35:29 -0400 Message-Id: <20210909173538.2380673-1-stefanb@linux.vnet.ibm.com> X-Mailer: git-send-email 2.31.1 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: Swly4K9McTWmoZrzlyhBwLYv7Pul5Zm- X-Proofpoint-GUID: Hw7Kn5gp5bxz235UR0LERp-LAlBzTRdS 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-09_06:2021-09-09,2021-09-09 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 adultscore=0 phishscore=0 malwarescore=0 suspectscore=0 priorityscore=1501 impostorscore=0 spamscore=0 mlxlogscore=999 lowpriorityscore=0 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109030001 definitions=main-2109090107 Content-Transfer-Encoding: 8bit This series imports code from the edk2-platforms project related to disabling the TPM2 platform hierarchy in Ovmf. 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 OvmfPkgX64.dsc. Neither one of the following commands should work anymore on first try when run on Linux: With IBM tss2 tools: tsshierarchychangeauth -hi p -pwdn newpass With Intel tss2 tools: tpm2_changeauth -c platform newpass Regards, Stefan v7: - Ditched ARM support in this series - Using Tcg2PlatformDxe and Tcg2PlaformPei from edk2-platforms now and revised most of the patches 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 Arm Stefan Berger (9): SecurityPkg/TPM: Import PeiDxeTpmPlatformHierarchyLib.c from edk2-platforms SecurityPkg/TPM: Fix bugs in imported PeiDxeTpmPlatformHierarchyLib SecrutiyPkg/Tcg: Import Tcg2PlatformDxe from edk2-platforms SecurityPkg/Tcg: Make Tcg2PlatformDxe buildable SecurityPkg: Introduce new PCD PcdRandomizePlatformHierarchy OvmfPkg: Reference new Tcg2PlatformDxe in the build system for compilation SecurityPkg/Tcg: Import Tcg2PlatformPei from edk2-platforms SecurityPkg/Tcg: Make Tcg2PlatformPei buildable OvmfPkg: Reference new Tcg2PlatformPei in the build system OvmfPkg/AmdSev/AmdSevX64.dsc | 8 + OvmfPkg/AmdSev/AmdSevX64.fdf | 2 + OvmfPkg/OvmfPkgIa32.dsc | 8 + OvmfPkg/OvmfPkgIa32.fdf | 2 + OvmfPkg/OvmfPkgIa32X64.dsc | 8 + OvmfPkg/OvmfPkgIa32X64.fdf | 2 + OvmfPkg/OvmfPkgX64.dsc | 8 + OvmfPkg/OvmfPkgX64.fdf | 2 + .../Include/Library/TpmPlatformHierarchyLib.h | 27 ++ .../PeiDxeTpmPlatformHierarchyLib.c | 255 ++++++++++++++++++ .../PeiDxeTpmPlatformHierarchyLib.inf | 44 +++ SecurityPkg/SecurityPkg.dec | 6 + .../Tcg/Tcg2PlatformDxe/Tcg2PlatformDxe.c | 85 ++++++ .../Tcg/Tcg2PlatformDxe/Tcg2PlatformDxe.inf | 43 +++ .../Tcg/Tcg2PlatformPei/Tcg2PlatformPei.c | 107 ++++++++ .../Tcg/Tcg2PlatformPei/Tcg2PlatformPei.inf | 51 ++++ 16 files changed, 658 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/Tcg/Tcg2PlatformDxe/Tcg2PlatformDxe.c create mode 100644 SecurityPkg/Tcg/Tcg2PlatformDxe/Tcg2PlatformDxe.inf create mode 100644 SecurityPkg/Tcg/Tcg2PlatformPei/Tcg2PlatformPei.c create mode 100644 SecurityPkg/Tcg/Tcg2PlatformPei/Tcg2PlatformPei.inf -- 2.31.1