[edk2-devel] [PATCH 4/5] MdeModulePkg/PiSmmIpl: Disallow stripped Image relocations
Marvin Häuser
mhaeuser at posteo.de
Sat Aug 21 19:55:52 UTC 2021
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.wang at intel.com>
Cc: Hao A Wu <hao.a.wu at intel.com>
Cc: Eric Dong <eric.dong at intel.com>
Cc: Ray Ni <ray.ni at intel.com>
Cc: Vitaly Cheptsov <vit9696 at protonmail.com>
Signed-off-by: Marvin Häuser <mhaeuser at 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/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list