From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by mx.groups.io with SMTP id smtpd.web09.30220.1631542874196957847 for ; Mon, 13 Sep 2021 07:21:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@ibm.com header.s=pp1 header.b=ey062RH1; 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 (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.0.43) with SMTP id 18DD02TA002524; Mon, 13 Sep 2021 10:21:12 -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=GZ0D6mLU9vPKwQoSjZDhGnKqE+uLzzWLOj2/UHQYeK0=; b=ey062RH1xSQ11s95cCZzJzMQ/kZd3kIebC5mBUmpIi+T3eNQPaLmc2rqbhAh1k6TXnWd CsWlMXFYu1YIpq0/eidM7vMAnRMWPEYmxkDk2KPbAzX94gzZHPe5U09es7SvtWzImM+B 5K1V2yeq6K06uSwYExUu1K3oixkcw5KpzcjseL/AZVBTCabF1n6aZHHTg4xc5iuN4/mC S3kSQy0nh7QOQNBH+69izuoy0PWZQMe2AAnAaMozHUwG2ufXzsVdjFCGNXAcdY9E9N+v FYpkfxlGRqoI9CWJXFzPyix4KgkBOtKa+gVwtg1higRAlIg+3f8EzqJ0DYH7ucD+FG// jw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3b232sh2xy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Sep 2021 10:21:12 -0400 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 18DBwp7T024687; Mon, 13 Sep 2021 10:21:12 -0400 Received: from ppma02wdc.us.ibm.com (aa.5b.37a9.ip4.static.sl-reverse.com [169.55.91.170]) by mx0a-001b2d01.pphosted.com with ESMTP id 3b232sh2xq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Sep 2021 10:21:12 -0400 Received: from pps.filterd (ppma02wdc.us.ibm.com [127.0.0.1]) by ppma02wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 18DEDg46009409; Mon, 13 Sep 2021 14:21:11 GMT Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by ppma02wdc.us.ibm.com with ESMTP id 3b0m3aa0yh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Sep 2021 14:21:11 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 18DELAOR46334210 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Sep 2021 14:21:10 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 50123136051; Mon, 13 Sep 2021 14:21:10 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DECF113606A; Mon, 13 Sep 2021 14:21:09 +0000 (GMT) Received: from sbct-2.pok.ibm.com (unknown [9.47.158.152]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 13 Sep 2021 14:21:09 +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 v8 00/10] Ovmf: Disable the TPM2 platform hierarchy Date: Mon, 13 Sep 2021 10:20:56 -0400 Message-Id: <20210913142106.2526997-1-stefanb@linux.vnet.ibm.com> X-Mailer: git-send-email 2.31.1 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: lVyi6wlmfPrPTKZv9HxtikwjsiPD0q6g X-Proofpoint-GUID: S48-3YehSzsSJ0ESyKb7cQLALrFEPPfl X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.687,Hydra:6.0.235,FMLib:17.0.607.475 definitions=2020-10-13_15,2020-10-13_02,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 malwarescore=0 clxscore=1015 mlxscore=0 phishscore=0 priorityscore=1501 suspectscore=0 adultscore=0 bulkscore=0 spamscore=0 impostorscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109030001 definitions=main-2109130045 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 v8: - Fixed style issue in imported code; added patch 10 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 (10): 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 and fix style issues 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 and fix style issues OvmfPkg: Reference new Tcg2PlatformPei in the build system SecurityPkg: Add references to header and inf files to SecurityPkg 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 | 43 +++ SecurityPkg/SecurityPkg.dec | 10 + SecurityPkg/SecurityPkg.dsc | 12 + .../Tcg/Tcg2PlatformDxe/Tcg2PlatformDxe.c | 85 ++++++ .../Tcg/Tcg2PlatformDxe/Tcg2PlatformDxe.inf | 43 +++ .../Tcg/Tcg2PlatformPei/Tcg2PlatformPei.c | 108 ++++++++ .../Tcg/Tcg2PlatformPei/Tcg2PlatformPei.inf | 52 ++++ 17 files changed, 675 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