summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStuart Yoder <stuart.yoder@arm.com>2023-02-10 06:30:58 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-02-15 04:29:36 +0000
commit68c1bedbf297b57a336a2edc046f1f9874ba69fa (patch)
tree46b6e3f56732f0b2b906bf76ddb9b1c502b45e9d
parent090642db7ac124c336da72e1954e1fb09e816fb0 (diff)
downloadedk2-68c1bedbf297b57a336a2edc046f1f9874ba69fa.tar.gz
edk2-68c1bedbf297b57a336a2edc046f1f9874ba69fa.tar.bz2
edk2-68c1bedbf297b57a336a2edc046f1f9874ba69fa.zip
MdeModulePkg/Variable: Attribute combination should return EFI_UNSUPPORTED
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4341 Commit 21320ef66989 broke some tests in the AuthVar_Conf test in edk2-test. There are 2 testcases that invoke SetVariable with the following attribute value: (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS) EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS is deprecated and the UEFI spec says this should return EFI_UNSUPPORTED. Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Sunny Wang <Sunny.Wang@arm.com> Signed-off-by: Stuart Yoder <stuart.yoder@arm.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Sunny Wang <sunny.wang@arm.com>
-rw-r--r--MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
index 6c1a3440ac..14c176887a 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
@@ -2676,7 +2676,11 @@ VariableServiceSetVariable (
//
// Only EFI_VARIABLE_NON_VOLATILE attribute is invalid
//
- return EFI_INVALID_PARAMETER;
+ if ((Attributes & EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS) != 0) {
+ return EFI_UNSUPPORTED;
+ } else {
+ return EFI_INVALID_PARAMETER;
+ }
} else if ((Attributes & VARIABLE_ATTRIBUTE_AT_AW) != 0) {
if (!mVariableModuleGlobal->VariableGlobal.AuthSupport) {
//