From: "Michael D Kinney" <michael.d.kinney@intel.com>
To: devel@edk2.groups.io
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>,
Hao A Wu <hao.a.wu@intel.com>,
Liming Gao <gaoliming@byosoft.com.cn>
Subject: [Patch 1/1] MdeModulePkg/Library/VarCheckLib: Allow SetVariable from SMM
Date: Tue, 5 Jan 2021 19:50:43 -0800 [thread overview]
Message-ID: <20210106035043.1412-1-michael.d.kinney@intel.com> (raw)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3154
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
is through the EFI_SMM_VARAIBLE_PROTOCOL.
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
MdeModulePkg/Library/VarCheckLib/VarCheckLib.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/MdeModulePkg/Library/VarCheckLib/VarCheckLib.c b/MdeModulePkg/Library/VarCheckLib/VarCheckLib.c
index 470d782444bf..9596d760e945 100644
--- a/MdeModulePkg/Library/VarCheckLib/VarCheckLib.c
+++ b/MdeModulePkg/Library/VarCheckLib/VarCheckLib.c
@@ -1,7 +1,7 @@
/** @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 (
DataSize,
Data
);
+ if (Status == EFI_WRITE_PROTECTED && RequestSource == VarCheckFromTrusted) {
+ //
+ // If RequestSource is trusted, then allow variable to be set even if it
+ // is write protected.
+ //
+ continue;
+ }
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_INFO, "Variable Check handler fail %r - %g:%s\n", Status, VendorGuid, VariableName));
return Status;
--
2.29.2.windows.2
next reply other threads:[~2021-01-06 3:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-06 3:50 Michael D Kinney [this message]
2021-01-06 4:13 ` [EXTERNAL] [edk2-devel] [Patch 1/1] MdeModulePkg/Library/VarCheckLib: Allow SetVariable from SMM Bret Barkelew
2021-01-06 5:46 ` Wu, Hao A
2021-01-06 16:53 ` Michael D Kinney
2021-01-07 1:02 ` Wu, Hao A
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210106035043.1412-1-michael.d.kinney@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox