From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web09.8863.1642483504765209026 for ; Mon, 17 Jan 2022 21:25:06 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Tue, 18 Jan 2022 13:24:52 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: , , Cc: "'Heinrich Schuchardt'" , "'G Edhaya Chandran'" , "'Samer El-Haj-Mahmoud'" References: <20220111213720.1358-1-Sunny.Wang@arm.com> <16C9607E4A3522C0.22643@groups.io> In-Reply-To: <16C9607E4A3522C0.22643@groups.io> Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BBVENIXSBNZGVNb2R1bGVQa2cvVmFyaWFibGU6IE1ha2Ugb25seSBFRklfVkFSSUFCTEVfTk9OX1ZPTEFUSUxFIGludmFsaWQ=?= Date: Tue, 18 Jan 2022 13:24:55 +0800 Message-ID: <002801d80c2b$ba28e940$2e7abbc0$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQIMGlR/9bABxZfqEbTtw8UZ4/bv6gH66Rc9q/BLdoA= Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Create https://github.com/tianocore/edk2/pull/2418 to merge it.=20 Thanks Liming > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: devel@edk2.groups.io =B4=FA=B1= =ED gaoliming > =B7=A2=CB=CD=CA=B1=BC=E4: 2022=C4=EA1=D4=C212=C8=D5 9:07 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io; Sunny.Wang@arm.com > =B3=AD=CB=CD: 'Heinrich Schuchardt' ; = 'G Edhaya > Chandran' ; 'Samer El-Haj-Mahmoud' > > =D6=F7=CC=E2: =BB=D8=B8=B4: [edk2-devel] [PATCH] MdeModulePkg/Variable: M= ake only > EFI_VARIABLE_NON_VOLATILE invalid >=20 > Reviewed-by: Liming Gao >=20 > > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > > =B7=A2=BC=FE=C8=CB: devel@edk2.groups.io =B4=FA= =B1=ED Sunny > Wang > > =B7=A2=CB=CD=CA=B1=BC=E4: 2022=C4=EA1=D4=C212=C8=D5 5:37 > > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io > > =B3=AD=CB=CD: Sunny Wang ; Liming Gao > > ; Heinrich Schuchardt > > ; G Edhaya Chandran > > ; Samer El-Haj-Mahmoud > > ; Sunny Wang > > > =D6=F7=CC=E2: [edk2-devel] [PATCH] MdeModulePkg/Variable: Make only > > EFI_VARIABLE_NON_VOLATILE invalid > > > > Only EFI_VARIABLE_NON_VOLATILE attribute is an invalid combination > > of attribute bits, so update the variable driver to return > > EFI_INVALID_PARAMETER so that we can prevent the invalid variable > > being created. > > > > This change also fixes the SCT failure below: > > - RT.QueryVariableInfo - With being an invalid combination -- FAILURE > > > > For details, please check the threads below: > > - https://edk2.groups.io/g/devel/topic/86486174 > > - https://edk2.groups.io/g/devel/message/82466 > > > > Cc: Liming Gao > > Cc: Heinrich Schuchardt > > Cc: G Edhaya Chandran > > Cc: Samer El-Haj-Mahmoud > > > > Signed-off-by: Sunny Wang > > --- > > .../Universal/Variable/RuntimeDxe/Variable.c | 16 > +++++++++++++++- > > 1 file changed, 15 insertions(+), 1 deletion(-) > > > > diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > > b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > > index 9722a94420..6c1a3440ac 100644 > > --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > > +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > > @@ -19,6 +19,7 @@ > > Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.
> > (C) Copyright 2015-2018 Hewlett Packard Enterprise Development > LP
> > Copyright (c) Microsoft Corporation.
> > +Copyright (c) 2022, ARM Limited. All rights reserved.
> > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > @@ -2660,14 +2661,22 @@ VariableServiceSetVariable ( > > } > > > > // > > - // Make sure if runtime bit is set, boot service bit is set also. > > + // Check if the combination of attribute bits is valid. > > // > > if ((Attributes & (EFI_VARIABLE_RUNTIME_ACCESS | > > EFI_VARIABLE_BOOTSERVICE_ACCESS)) =3D=3D > EFI_VARIABLE_RUNTIME_ACCESS) > > { > > + // > > + // Make sure if runtime bit is set, boot service bit is set also. > > + // > > if ((Attributes & EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS) !=3D > 0) > > { > > return EFI_UNSUPPORTED; > > } else { > > return EFI_INVALID_PARAMETER; > > } > > + } else if ((Attributes & EFI_VARIABLE_ATTRIBUTES_MASK) =3D=3D > > EFI_VARIABLE_NON_VOLATILE) { > > + // > > + // Only EFI_VARIABLE_NON_VOLATILE attribute is invalid > > + // > > + return EFI_INVALID_PARAMETER; > > } else if ((Attributes & VARIABLE_ATTRIBUTE_AT_AW) !=3D 0) { > > if (!mVariableModuleGlobal->VariableGlobal.AuthSupport) { > > // > > @@ -3142,6 +3151,11 @@ VariableServiceQueryVariableInfo ( > > // Make sure the Attributes combination is supported by the > platform. > > // > > return EFI_UNSUPPORTED; > > + } else if ((Attributes & EFI_VARIABLE_ATTRIBUTES_MASK) =3D=3D > > EFI_VARIABLE_NON_VOLATILE) { > > + // > > + // Only EFI_VARIABLE_NON_VOLATILE attribute is invalid > > + // > > + return EFI_INVALID_PARAMETER; > > } else if ((Attributes & (EFI_VARIABLE_RUNTIME_ACCESS | > > EFI_VARIABLE_BOOTSERVICE_ACCESS)) =3D=3D > EFI_VARIABLE_RUNTIME_ACCESS) > > { > > // > > // Make sure if runtime bit is set, boot service bit is set also. > > -- > > 2.33.0.windows.2 > > > > > > > > -=3D-=3D-=3D-=3D-=3D-=3D > > Groups.io Links: You receive all messages sent to this group. > > View/Reply Online (#85574): > https://edk2.groups.io/g/devel/message/85574 > > Mute This Topic: https://groups.io/mt/88359863/4905953 > > Group Owner: devel+owner@edk2.groups.io > > Unsubscribe: https://edk2.groups.io/g/devel/unsub > > [gaoliming@byosoft.com.cn] > > -=3D-=3D-=3D-=3D-=3D-=3D > > >=20 >=20 >=20 >=20 >=20 >=20 >=20