From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from walk.intel-email.com (walk.intel-email.com [101.227.64.242]) by mx.groups.io with SMTP id smtpd.web08.70361.1656928814242654702 for ; Mon, 04 Jul 2022 03:00:14 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@byosoft.com.cn header.s=cloud-union header.b=iAb8yYL1; spf=pass (domain: byosoft.com.cn, ip: 101.227.64.242, mailfrom: xueshengfeng@byosoft.com.cn) Received: from walk.intel-email.com (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id BCB0CCD1F7E0 for ; Mon, 4 Jul 2022 18:00:10 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=byosoft.com.cn; s=cloud-union; t=1656928810; bh=Pkodx3jvFB8g5IoAH0XtBuYhM5nwT2OrNR5jGa2XHUg=; h=From:To:Cc:Subject:Date; b=iAb8yYL1SQMkHAzJfo+A7HkQcHP89zHUiyS2IGGOdtMezaGY+OehMlMebnTMFnfbj LzGQbgvEsjqMy8ilRUICMt0UF9gl1C2mAnFyPlHK3KwkSW/LwHPO1pqHVg8OKhGuBr 6i1wR9kMlxHXLa4sNp+yeaJ0n8dfGxGyYDO1efjg= Received: from localhost (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id B78B0CD1F7DE for ; Mon, 4 Jul 2022 18:00:10 +0800 (CST) X-Virus-Scanned: by SpamTitan at intel-email.com Received: from walk.intel-email.com (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id 6D3B5CD1F6BA for ; Mon, 4 Jul 2022 18:00:10 +0800 (CST) Authentication-Results: walk.intel-email.com; none Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by walk.intel-email.com (Postfix) with SMTP id 8E90CCD1F7F6 for ; Mon, 4 Jul 2022 18:00:07 +0800 (CST) Received: from localhost.localdomain ([58.212.134.2]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Mon, 04 Jul 2022 17:59:58 +0800 X-WM-Sender: xueshengfeng@byosoft.com.cn X-Originating-IP: 58.212.134.2 X-WM-AuthFlag: YES X-WM-AuthUser: xueshengfeng@byosoft.com.cn From: xueshengfeng To: devel@edk2.groups.io Cc: gaoliming@byosoft.com.cn, edhaya.chandran@arm.com, samer.el-haj-mahmoud@arm.com, sunny.wang@arm.com, Lijun10x Subject: [PATCH] MdeModulePkg/Variable: SCT run AuthVar_conf is failed Date: Mon, 4 Jul 2022 17:59:48 +0800 Message-Id: <7d6c057e3c99869d75dd11d3a77671a3ec33ef2e.1656642493.git.junx1.li@intel.com> X-Mailer: git-send-email 2.31.1.windows.1 MIME-Version: 1.0 Sender: xueshengfeng Content-Transfer-Encoding: quoted-printable From: Lijun10x REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3969 Attr are EFI_VARIABLE_NON_VOLATILE|VARIABLE_AUTHENTICATED_WRITE_ACCESS, will return EFI_INVALID_PARAMETER. Added one case, only when one attribute is EFI_VARIABLE_NON_VOLATILE will EFI_INVALID_PARAMETER be returned. If attr are EFI_VARIABLE_NON_VOLATILE|VARIABLE_AUTHENTICATED_WRITE_ACCESS will return EFI_UNSUPPORTED. In the UEFI2.7 spec, there is a description as below: EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS is deprecated and should not be used. Platforms should return EFI_UNSUPPORTED if a caller to SetVariable() specifies this attribute. Signed-off-by: JunX1 Li Reviewed-by: Liming Gao Reviewed-by: G Edhaya Chandran Reviewed-by: Samer El-Haj-Mahmoud Reviewed-by: Sunny Wang --- MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeM= odulePkg/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) !=3D 0) { + return EFI_UNSUPPORTED; + } else { + return EFI_INVALID_PARAMETER; + } } else if ((Attributes & VARIABLE_ATTRIBUTE_AT_AW) !=3D 0) { if (!mVariableModuleGlobal->VariableGlobal.AuthSupport) { // --=20 2.26.2.windows.1