Hello community,

here is the log from the commit of package ovmf for openSUSE:Factory:NonFree 
checked in at 2016-03-26 15:29:50
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory:NonFree/ovmf (Old)
 and      /work/SRC/openSUSE:Factory:NonFree/.ovmf.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ovmf"

Changes:
--------
--- /work/SRC/openSUSE:Factory:NonFree/ovmf/ovmf.changes        2016-03-17 
16:49:52.000000000 +0100
+++ /work/SRC/openSUSE:Factory:NonFree/.ovmf.new/ovmf.changes   2016-03-27 
10:11:20.000000000 +0200
@@ -1,0 +2,6 @@
+Wed Mar 23 09:22:25 UTC 2016 - [email protected]
+
+- Add ovmf-fix-choose-handlers-crash.patch to fix the crash while
+  selecting files from BootMaintenanceManager and SecureBootConfig
+
+-------------------------------------------------------------------

New:
----
  ovmf-fix-choose-handlers-crash.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ovmf.spec ++++++
--- /var/tmp/diff_new_pack.byJyjW/_old  2016-03-27 10:11:29.000000000 +0200
+++ /var/tmp/diff_new_pack.byJyjW/_new  2016-03-27 10:11:29.000000000 +0200
@@ -48,6 +48,7 @@
 Patch2:         %{name}-embed-default-keys.patch
 Patch3:         %{name}-gdb-symbols.patch
 Patch4:         %{name}-fix-httpboot-driver-model.patch
+Patch5:         %{name}-fix-choose-handlers-crash.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildRequires:  libuuid-devel
 BuildRequires:  fdupes
@@ -156,6 +157,7 @@
 %endif
 %patch3 -p1
 %patch4 -p1
+%patch5 -p1
 # Intel has special patches for openssl
 pushd CryptoPkg/Library/OpensslLib/openssl-%{openssl_version}
 patch -p1 -i ../EDKII_openssl-%{openssl_version}.patch







++++++ ovmf-fix-choose-handlers-crash.patch ++++++
>From 53e0bdb8c60d6f88b317888d55d8a8eaf26f5e59 Mon Sep 17 00:00:00 2001
From: Gary Lin <[email protected]>
Date: Mon, 21 Mar 2016 14:49:57 +0800
Subject: [PATCH 1/4] SecurityPkg/SecureBootConfigDxe: Declare EFIAPI for the
 ChooseFile handlers

The SecureBootConfig now uses ChooseFile() from FileExplorerLib
to select the certificates to be enrolled into PK, KEK, DB, DBX,
or DBT, and the corresponding handlers to get the content of the
file. Per the definition of CHOOSE_HANDLER, the handler must use
EFIAPI as the calling convention. However, the calling convention
was not specified the following handlers: UpdatePKFromFile(),
UpdateKEKFromFile(), UpdateDBFromFile(), UpdateDBXFromFile(), and
UpdateDBTFromFile(). When compiling the firmware with gcc, the
default calling convention is not compatible with EFIAPI, so the
handlers interpreted the argument the wrong way and passed the
wrong device path to UpdatePage(), and the system crashed when
the user tried to enroll a certificate into the key database.

This commit specifies the calling convention for those functions
so that gcc can generate the right code.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <[email protected]>
---
 .../SecureBootConfigDxe/SecureBootConfigFileExplorer.c               | 5 +++++
 .../VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.h | 5 +++++
 2 files changed, 10 insertions(+)

diff --git 
a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigFileExplorer.c
 
b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigFileExplorer.c
index 05d97dc..1b6f888 100644
--- 
a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigFileExplorer.c
+++ 
b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigFileExplorer.c
@@ -343,6 +343,7 @@ UpdatePage(
   @retval FALSE  Not exit caller function.
 **/
 BOOLEAN
+EFIAPI
 UpdatePKFromFile (
   IN EFI_DEVICE_PATH_PROTOCOL    *FilePath
   )
@@ -360,6 +361,7 @@ UpdatePKFromFile (
   @retval FALSE  Not exit caller function.
 **/
 BOOLEAN
+EFIAPI
 UpdateKEKFromFile (
   IN EFI_DEVICE_PATH_PROTOCOL    *FilePath
   )
@@ -376,6 +378,7 @@ UpdateKEKFromFile (
   @retval FALSE  Not exit caller function.
 **/
 BOOLEAN
+EFIAPI
 UpdateDBFromFile (
   IN EFI_DEVICE_PATH_PROTOCOL    *FilePath
   )
@@ -392,6 +395,7 @@ UpdateDBFromFile (
   @retval FALSE  Not exit caller function.
 **/
 BOOLEAN
+EFIAPI
 UpdateDBXFromFile (
   IN EFI_DEVICE_PATH_PROTOCOL    *FilePath
   )
@@ -408,6 +412,7 @@ UpdateDBXFromFile (
   @retval FALSE  Not exit caller function.
 **/
 BOOLEAN
+EFIAPI
 UpdateDBTFromFile (
   IN EFI_DEVICE_PATH_PROTOCOL    *FilePath
   )
diff --git 
a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.h 
b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.h
index a8dbd92..1ee9580 100644
--- 
a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.h
+++ 
b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.h
@@ -561,6 +561,7 @@ GuidToString (
   @retval FALSE  Not exit caller function.
 **/
 BOOLEAN
+EFIAPI
 UpdatePKFromFile (
   IN EFI_DEVICE_PATH_PROTOCOL    *FilePath
   );
@@ -574,6 +575,7 @@ UpdatePKFromFile (
   @retval FALSE  Not exit caller function.
 **/
 BOOLEAN
+EFIAPI
 UpdateKEKFromFile (
   IN EFI_DEVICE_PATH_PROTOCOL    *FilePath
   );
@@ -587,6 +589,7 @@ UpdateKEKFromFile (
   @retval FALSE  Not exit caller function.
 **/
 BOOLEAN
+EFIAPI
 UpdateDBFromFile (
   IN EFI_DEVICE_PATH_PROTOCOL    *FilePath
   );
@@ -600,6 +603,7 @@ UpdateDBFromFile (
   @retval FALSE  Not exit caller function.
 **/
 BOOLEAN
+EFIAPI
 UpdateDBXFromFile (
   IN EFI_DEVICE_PATH_PROTOCOL    *FilePath
   );
@@ -613,6 +617,7 @@ UpdateDBXFromFile (
   @retval FALSE  Not exit caller function.
 **/
 BOOLEAN
+EFIAPI
 UpdateDBTFromFile (
   IN EFI_DEVICE_PATH_PROTOCOL    *FilePath
   );
-- 
2.7.3


>From 74bdfb5fea9d226a73feac01e8729fa22bb0c6fe Mon Sep 17 00:00:00 2001
From: Gary Lin <[email protected]>
Date: Mon, 21 Mar 2016 16:41:30 +0800
Subject: [PATCH 2/4] SecurityPkg/SecureBootConfigDxe: Remove type casting from
 the ChooseFile handlers

The type casting in the ChooseFile is not necessary and it actually
hided the incompatible handlers from the compiler.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <[email protected]>
---
 .../SecureBootConfigDxe/SecureBootConfigImpl.c                 | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c 
b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
index 8ca6d62..e840316 100644
--- 
a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
+++ 
b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
@@ -3590,23 +3590,23 @@ SecureBootCallback (
       break;
 
     case FORMID_ENROLL_PK_FORM:
-      ChooseFile( NULL, NULL, (CHOOSE_HANDLER) UpdatePKFromFile, &File);
+      ChooseFile (NULL, NULL, UpdatePKFromFile, &File);
       break;
 
     case FORMID_ENROLL_KEK_FORM:
-      ChooseFile( NULL, NULL, (CHOOSE_HANDLER) UpdateKEKFromFile, &File);
+      ChooseFile (NULL, NULL, UpdateKEKFromFile, &File);
       break;
 
     case SECUREBOOT_ENROLL_SIGNATURE_TO_DB:
-      ChooseFile( NULL, NULL, (CHOOSE_HANDLER) UpdateDBFromFile, &File);
+      ChooseFile (NULL, NULL, UpdateDBFromFile, &File);
       break;
 
     case SECUREBOOT_ENROLL_SIGNATURE_TO_DBX:
-      ChooseFile( NULL, NULL, (CHOOSE_HANDLER) UpdateDBXFromFile, &File);
+      ChooseFile (NULL, NULL, UpdateDBXFromFile, &File);
       break;
 
     case SECUREBOOT_ENROLL_SIGNATURE_TO_DBT:
-      ChooseFile( NULL, NULL, (CHOOSE_HANDLER) UpdateDBTFromFile, &File);
+      ChooseFile (NULL, NULL, UpdateDBTFromFile, &File);
       break;
 
     case KEY_SECURE_BOOT_DELETE_PK:
-- 
2.7.3


>From db31d63a8b7d39188a001608167758fa64eb9f49 Mon Sep 17 00:00:00 2001
From: Dandan Bi <[email protected]>
Date: Tue, 22 Mar 2016 11:37:16 +0800
Subject: [PATCH 3/4] MdeModulePkg/BootMaintManagerUiLib: Declare EFIAPI for
 ChooseFile handler

The BootMaintenanceManagerUiLib use ChooseFile() from FileExplorerLib
to select files. And the third parameter in ChooseFile() is CHOOSE_HANDLER,
per the definition of CHOOSE_HANDLER, it must use EFIAPI as the calling
convention. But the calling convention was not specified for following
handlers: CreateBootOptionFromFile, CreateDriverOptionFromFile,
BootFromFile. Now specifies the calling convention for those functions.

Cc: Liming Gao <[email protected]>
Cc: Eric Dong <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <[email protected]>
---
 .../Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.h       | 3 +++
 MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootOption.c          | 3 +++
 2 files changed, 6 insertions(+)

diff --git 
a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.h 
b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.h
index 2c93446..d607314 100644
--- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.h
+++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.h
@@ -1305,6 +1305,7 @@ BootMaintCallback (
 
 **/
 BOOLEAN 
+EFIAPI
 CreateBootOptionFromFile (
   IN EFI_DEVICE_PATH_PROTOCOL    *FilePath
   );
@@ -1318,6 +1319,7 @@ CreateBootOptionFromFile (
   @retval FALSE  Not exit caller function.
 **/
 BOOLEAN 
+EFIAPI
 CreateDriverOptionFromFile (
   IN EFI_DEVICE_PATH_PROTOCOL    *FilePath
   );
@@ -1332,6 +1334,7 @@ CreateDriverOptionFromFile (
   
 **/
 BOOLEAN 
+EFIAPI
 BootFromFile (
   IN EFI_DEVICE_PATH_PROTOCOL    *FilePath
   );
diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootOption.c 
b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootOption.c
index 0bd3170..7a014c9 100644
--- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootOption.c
+++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootOption.c
@@ -857,6 +857,7 @@ GetDriverOrder (
   @retval FALSE  Not exit caller function.
 **/
 BOOLEAN 
+EFIAPI
 BootFromFile (
   IN EFI_DEVICE_PATH_PROTOCOL    *FilePath
   )
@@ -929,6 +930,7 @@ ReSendForm(
   @retval FALSE  Not exit caller function.
 **/
 BOOLEAN 
+EFIAPI
 CreateBootOptionFromFile (
   IN EFI_DEVICE_PATH_PROTOCOL    *FilePath
   )
@@ -946,6 +948,7 @@ CreateBootOptionFromFile (
 
 **/
 BOOLEAN 
+EFIAPI
 CreateDriverOptionFromFile (
   IN EFI_DEVICE_PATH_PROTOCOL    *FilePath
   )
-- 
2.7.3


>From a1b7e6ef420ce4574a61f1ad55c2b51ae24ee892 Mon Sep 17 00:00:00 2001
From: Dandan Bi <[email protected]>
Date: Tue, 22 Mar 2016 11:37:17 +0800
Subject: [PATCH 4/4] MdeModulePkg/BootMaintenanceManagerUiLib: Remove type
 casting in ChooseFile

The type casting is not necessary and now remove it.

Cc: Liming Gao <[email protected]>
Cc: Eric Dong <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <[email protected]>
---
 MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c 
b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
index 745f971..a34ac85 100644
--- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
+++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
@@ -902,12 +902,12 @@ BootMaintCallback (
         switch (QuestionId) {
         case FORM_BOOT_ADD_ID:
           // Leave BMM and enter FileExplorer. 
-          ChooseFile( NULL, L".efi", (CHOOSE_HANDLER) 
CreateBootOptionFromFile, &File);
+          ChooseFile (NULL, L".efi", CreateBootOptionFromFile, &File);
           break;
 
         case FORM_DRV_ADD_FILE_ID:
           // Leave BMM and enter FileExplorer.
-          ChooseFile( NULL, L".efi", (CHOOSE_HANDLER) 
CreateDriverOptionFromFile, &File);
+          ChooseFile (NULL, L".efi", CreateDriverOptionFromFile, &File);
           break;
 
         case FORM_DRV_ADD_HANDLE_ID:
@@ -983,7 +983,7 @@ BootMaintCallback (
     }
     if (QuestionId == KEY_VALUE_BOOT_FROM_FILE){
       // Leave BMM and enter FileExplorer.
-      ChooseFile( NULL, L".efi", (CHOOSE_HANDLER) BootFromFile, &File);
+      ChooseFile (NULL, L".efi", BootFromFile, &File);
     }
   } else if (Action == EFI_BROWSER_ACTION_CHANGED) {
     if ((Value == NULL) || (ActionRequest == NULL)) {
-- 
2.7.3


Reply via email to