The SMM stack does not support loading Images to preferred addresses
in any way. Add checks that Image relocations have not been stripped.

Cc: Jian J Wang <jian.j.w...@intel.com>
Cc: Hao A Wu <hao.a...@intel.com>
Cc: Eric Dong <eric.d...@intel.com>
Cc: Ray Ni <ray...@intel.com>
Cc: Vitaly Cheptsov <vit9...@protonmail.com>
Signed-off-by: Marvin Häuser <mhaeu...@posteo.de>
---
 MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c 
b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c
index 599a0cd01d80..d70b6e8ff46d 100644
--- a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c
+++ b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c
@@ -1049,6 +1049,15 @@ ExecuteSmmCoreFromSmram (
   if (EFI_ERROR (Status)) {

     return Status;

   }

+

+  //

+  // Stripped Image relocations are not supported for both fixed-address and

+  // dynamic loading.

+  //

+  if (ImageContext.RelocationsStripped) {

+    return EFI_UNSUPPORTED;

+  }

+

   //

   // if Loading module at Fixed Address feature is enabled, the SMM core 
driver will be loaded to

   // the address assigned by build tool.

-- 
2.31.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#79675): https://edk2.groups.io/g/devel/message/79675
Mute This Topic: https://groups.io/mt/85048613/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to