Revert "MdeModulePkg: Enable forward edge CFI in mem attributes table"

This reverts commit e4ef609319.
This commit is contained in:
Mikhail Krichanov 2023-06-26 12:04:30 +03:00
parent 769c333a61
commit 7886691a93
3 changed files with 1 additions and 19 deletions

View File

@ -261,8 +261,6 @@ extern EFI_MEMORY_TYPE_INFORMATION gMemoryTypeInformation[EfiMaxMemoryType
extern BOOLEAN gDispatcherRunning;
extern EFI_RUNTIME_ARCH_PROTOCOL gRuntimeTemplate;
extern BOOLEAN gMemoryAttributesTableForwardCfi;
extern EFI_LOAD_FIXED_ADDRESS_CONFIGURATION_TABLE gLoadModuleAtFixAddressConfigurationTable;
extern BOOLEAN gLoadFixedAddressCodeMemoryReady;
extern LOADED_IMAGE_PRIVATE_DATA * mCurrentImage;

View File

@ -1336,16 +1336,6 @@ CoreLoadImageCommon (
CoreNewDebugImageInfoEntry (EFI_DEBUG_IMAGE_INFO_TYPE_NORMAL, &Image->Info, Image->Handle, &ImageContext);
}
//
// Check whether we are loading a runtime image that lacks support for
// IBT/BTI landing pads.
//
if ((Image->ImageContext.ImageCodeMemoryType == EfiRuntimeServicesCode) &&
((Image->ImageContext.DllCharacteristicsEx & EFI_IMAGE_DLLCHARACTERISTICS_EX_FORWARD_CFI_COMPAT) == 0))
{
gMemoryAttributesTableForwardCfi = FALSE;
}
//
// Reinstall loaded image protocol to fire any notifications
//

View File

@ -92,7 +92,6 @@ BOOLEAN mMemoryAttributesTableEnable = TRUE;
BOOLEAN mMemoryAttributesTableEndOfDxe = FALSE;
EFI_MEMORY_ATTRIBUTES_TABLE *mMemoryAttributesTable = NULL;
BOOLEAN mMemoryAttributesTableReadyToBoot = FALSE;
BOOLEAN gMemoryAttributesTableForwardCfi = TRUE;
/**
Install MemoryAttributesTable.
@ -186,12 +185,7 @@ InstallMemoryAttributesTable (
MemoryAttributesTable->Version = EFI_MEMORY_ATTRIBUTES_TABLE_VERSION;
MemoryAttributesTable->NumberOfEntries = RuntimeEntryCount;
MemoryAttributesTable->DescriptorSize = (UINT32)DescriptorSize;
if (gMemoryAttributesTableForwardCfi) {
MemoryAttributesTable->Flags = EFI_MEMORY_ATTRIBUTES_FLAGS_RT_FORWARD_CONTROL_FLOW_GUARD;
} else {
MemoryAttributesTable->Flags = 0;
}
MemoryAttributesTable->Flags = 0;
DEBUG ((DEBUG_VERBOSE, "MemoryAttributesTable:\n"));
DEBUG ((DEBUG_VERBOSE, " Version - 0x%08x\n", MemoryAttributesTable->Version));
DEBUG ((DEBUG_VERBOSE, " NumberOfEntries - 0x%08x\n", MemoryAttributesTable->NumberOfEntries));