]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/Variable: Attribute combination should return EFI_UNSUPPORTED
authorStuart Yoder <stuart.yoder@arm.com>
Thu, 9 Feb 2023 22:30:58 +0000 (06:30 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 15 Feb 2023 04:29:36 +0000 (04:29 +0000)
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>
MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c

index 6c1a3440ac8cf5abe085e451fe15d857f25db3f4..14c176887a559815494c4590fc687272926334b5 100644 (file)
@@ -2676,7 +2676,11 @@ VariableServiceSetVariable (
     //\r
     // Only EFI_VARIABLE_NON_VOLATILE attribute is invalid\r
     //\r
-    return EFI_INVALID_PARAMETER;\r
+    if ((Attributes & EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS) != 0) {\r
+      return EFI_UNSUPPORTED;\r
+    } else {\r
+      return EFI_INVALID_PARAMETER;\r
+    }\r
   } else if ((Attributes & VARIABLE_ATTRIBUTE_AT_AW) != 0) {\r
     if (!mVariableModuleGlobal->VariableGlobal.AuthSupport) {\r
       //\r