mirror of
https://github.com/acidanthera/audk.git
synced 2025-09-26 11:08:42 +02:00
According to TCG's Platform Reset Attack Mitigation spec, the OS should never create the MOR variable, only read and write it. But some OSes (Fedora 24 and 25) don't follow the TCG's Platform Reset Attack Mitigation spec and unintentionally create MOR variable. The commit fda8f631edbbf3823760542a06f12bd60fd39181 added function VariableHaveTcgProtocols() to check against Tcg/Tcg2 protocol to infer whether the MOR variable is created by platform firmware or not. If not, delete the variable created by OS and lock the variable to avoid OS to create it. But in VariableStandaloneMm, VariableHaveTcgProtocols() always returns FALSE, it causes TCG MOR secure feature does not work in standalone MM environment. As Fedora 24 and 25 are EOL today, directly returns TRUE in the function VariableHaveTcgProtocols() for VariableStandaloneMm, and rename the function to VariableIsMorVariableLegitimate() to make it more obvious what the narrow use-case is for which it exists. Signed-off-by: Wei6 Xu <wei6.xu@intel.com>