]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/PlatformBootManagerLib: process TPM PPI request
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Fri, 18 May 2018 12:23:04 +0000 (14:23 +0200)
committerLaszlo Ersek <lersek@redhat.com>
Tue, 22 May 2018 14:30:44 +0000 (16:30 +0200)
Call Tcg2PhysicalPresenceLibProcessRequest() to process pending PPI
requests from PlatformBootManagerAfterConsole().

Laszlo understanding of edk2 is that the PPI operation processing was
meant to occur *entirely* before End-Of-Dxe, so that 3rd party UEFI
drivers couldn't interfere with PPI opcode processing *at all*.

He suggested that we should *not* call
Tcg2PhysicalPresenceLibProcessRequest() from BeforeConsole(). Because,
an "auth" console, i.e. one that does not depend on a 3rd party
driver, is *in general* impossible to guarantee. Instead we could opt
to trust 3rd party drivers, and use the "normal" console(s) in
AfterConsole(), in order to let the user confirm the PPI requests. It
will depend on the user to enable Secure Boot, so that the
trustworthiness of those 3rd party drivers is ensured. If an attacker
roots the guest OS from within, queues some TPM2 PPI requests, and
also modifies drivers on the EFI system partition and/or in GPU option
ROMs (?), then those drivers will not load after guest reboot, and
thus the dependent console(s) won't be used for confirming the PPI
requests.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf

index 5d4d323d730665bdaad25568214f8cbe557e927e..57870cb856e51a722bcc19984f548810d43c1465 100644 (file)
@@ -16,6 +16,7 @@
 #include <Guid/XenInfo.h>\r
 #include <Guid/RootBridgesConnectedEventGroup.h>\r
 #include <Protocol/FirmwareVolume2.h>\r
+#include <Library/Tcg2PhysicalPresenceLib.h>\r
 \r
 \r
 //\r
@@ -1515,6 +1516,11 @@ PlatformBootManagerAfterConsole (
   //\r
   PciAcpiInitialization ();\r
 \r
+  //\r
+  // Process TPM PPI request\r
+  //\r
+  Tcg2PhysicalPresenceLibProcessRequest (NULL);\r
+\r
   //\r
   // Process QEMU's -kernel command line option\r
   //\r
index 27789b7377bcb8bdcb17b0442ed751437fc21c84..4b72c44bcf0adaec4d3153da191c8fb7afcbae52 100644 (file)
@@ -38,6 +38,7 @@
   IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec\r
   SourceLevelDebugPkg/SourceLevelDebugPkg.dec\r
   OvmfPkg/OvmfPkg.dec\r
+  SecurityPkg/SecurityPkg.dec\r
 \r
 [LibraryClasses]\r
   BaseLib\r
@@ -56,6 +57,7 @@
   LoadLinuxLib\r
   QemuBootOrderLib\r
   UefiLib\r
+  Tcg2PhysicalPresenceLib\r
 \r
 [Pcd]\r
   gUefiOvmfPkgTokenSpaceGuid.PcdEmuVariableEvent\r