Commit 75ab038d authored by Michael D Kinney's avatar Michael D Kinney Committed by mergify[bot]
Browse files

MdeModulePkg/Library/VarCheckLib: Allow SetVariable from SMM


Update VarCheckLibSetVariableCheck() to allow locked variables
to be updated if the RequestSource is VarCheckFromTrusted even
if one or more variable check handlers return EFI_WRITE_PROTECTED.
RequestSource is only set to VarCheckFromTrusted if the request

Cc: Bret Barkelew <>
Cc: Hao A Wu <>
Cc: Liming Gao <>
Signed-off-by: default avatarMichael D Kinney <>
Reviewed-by: default avatarBret Barkelew <>
Reviewed-by: default avatarHao A Wu <>
(cherry picked from commit 248d08c5

Reviewed-by: default avatarLiming Gao <>
parent 184ece2d
/** @file
Implementation functions and structures for var check services.
Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
......@@ -655,6 +655,13 @@ VarCheckLibSetVariableCheck (
if (Status == EFI_WRITE_PROTECTED && RequestSource == VarCheckFromTrusted) {
// If RequestSource is trusted, then allow variable to be set even if it
// is write protected.
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_INFO, "Variable Check handler fail %r - %g:%s\n", Status, VendorGuid, VariableName));
return Status;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment