audk/EmbeddedPkg/Drivers/MemoryAttributeManagerDxe/MemoryAttributeManagerDxeHii.vfr
Mario Bălănică f9c373c838 EmbeddedPkg: Add option to disable EFI Memory Attribute Protocol
Introduce a driver that allows users to disable the EFI Memory Attribute
protocol through an HII setup option, in order to work around a broken
version of rhboot's shim used in some distros (e.g. CentOS Stream 9)
which incorrectly invokes the protocol and results in a Synchronous
Exception.

Default is enabled, which can also be overridden at build time by
changing `gEmbeddedTokenSpaceGuid.PcdMemoryAttributeEnabledDefault`.

It is only applicable to ARM64 and there isn't any other technical
reason for disabling this security feature.

See:
- https://github.com/microsoft/mu_silicon_arm_tiano/issues/124
- https://edk2.groups.io/g/devel/topic/99631663
- https://github.com/tianocore/edk2/pull/5840

Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2024-07-16 09:54:07 +00:00

36 lines
1.1 KiB
Plaintext

/** @file
Copyright (c) 2023-2024, Mario Bălănică <mariobalanica02@gmail.com>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include <Uefi/UefiMultiPhase.h>
#include <Guid/HiiPlatformSetupFormset.h>
#include "MemoryAttributeManagerDxe.h"
formset
guid = MEMORY_ATTRIBUTE_MANAGER_FORMSET_GUID,
title = STRING_TOKEN(STR_FORM_SET_TITLE),
help = STRING_TOKEN(STR_FORM_SET_TITLE_HELP),
classguid = EFI_HII_PLATFORM_SETUP_FORMSET_GUID,
efivarstore MEMORY_ATTRIBUTE_MANAGER_VARSTORE_DATA,
attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE,
name = MemoryAttributeManagerData,
guid = MEMORY_ATTRIBUTE_MANAGER_FORMSET_GUID;
form formid = 1,
title = STRING_TOKEN(STR_FORM_SET_TITLE);
checkbox varid = MemoryAttributeManagerData.Enabled,
prompt = STRING_TOKEN(STR_ENABLE_PROTOCOL_PROMPT),
help = STRING_TOKEN(STR_NULL_STRING),
flags = CHECKBOX_DEFAULT | CHECKBOX_DEFAULT_MFG | RESET_REQUIRED,
default = PROTOCOL_ENABLED_DEFAULT,
endcheckbox;
endform;
endformset;