[edk2-devel] [PATCH] MdeModulePkg/Variable: Attribute combination should return EFI_UNSUPPORTED

Sunny Wang Sunny.Wang at arm.com
Mon Feb 13 10:42:56 UTC 2023


Looks good to me. Thanks, Stuart.
Reviewed-by: Sunny Wang <sunny.wang at arm.com>

-----Original Message-----
From: Stuart Yoder <stuart.yoder at arm.com>
Sent: 09 February 2023 22:31
To: devel at edk2.groups.io
Cc: gaoliming at byosoft.com.cn; hao.a.wu at intel.com; Sunny Wang <Sunny.Wang at arm.com>
Subject: [PATCH] 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 at byosoft.com.cn>
Cc: Hao A Wu <hao.a.wu at intel.com>
Cc: Sunny Wang <Sunny.Wang at arm.com>

Signed-off-by: Stuart Yoder <stuart.yoder at arm.com>
---
 MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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) {

       //

--
2.34.1

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100075): https://edk2.groups.io/g/devel/message/100075
Mute This Topic: https://groups.io/mt/96864645/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list