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.web08.1479.1610096650356946760 for ; Fri, 08 Jan 2021 01:04:10 -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 ; Fri, 08 Jan 2021 17:03:53 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: , Cc: "'Bret Barkelew'" , "'Hao A Wu'" References: <20210107174826.1453-1-michael.d.kinney@intel.com> In-Reply-To: <20210107174826.1453-1-michael.d.kinney@intel.com> Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW3N0YWJsZS8yMDIwMTFdW1BhdGNoIDEvMV0gTWRlTW9kdWxlUGtnL0xpYnJhcnkvVmFyQ2hlY2tMaWI6IEFsbG93IFNldFZhcmlhYmxlIGZyb20gU01N?= Date: Fri, 8 Jan 2021 17:03:58 +0800 Message-ID: <005101d6e59d$337eea30$9a7cbe90$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQIt4GK2bHxMzv9Xeg2cwsq39VOLj6lveYCQ Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Reviewed-by: Liming Gao > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: bounce+27952+69945+4905953+8761045@groups.io > =B4=FA=B1=ED Michael D > Kinney > =B7=A2=CB=CD=CA=B1=BC=E4: 2021=C4=EA1=D4=C28=C8=D5 1:48 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io > =B3=AD=CB=CD: Bret Barkelew ; Hao A Wu > ; Liming Gao ; Bret > Barkelew > =D6=F7=CC=E2: [edk2-devel] [stable/202011][Patch 1/1] > MdeModulePkg/Library/VarCheckLib: Allow SetVariable from SMM >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3154 >=20 > Update VarCheckLibSetVariableCheck() to allow locked variables > to be updated if the RequestSource is VarCheckFromTrusted even > if one or more variable check handlers return EFI_WRITE_PROTECTED. > RequestSource is only set to VarCheckFromTrusted if the request > is through the EFI_SMM_VARAIBLE_PROTOCOL. >=20 > Cc: Bret Barkelew > Cc: Hao A Wu > Cc: Liming Gao > Signed-off-by: Michael D Kinney > Reviewed-by: Bret Barkelew > Reviewed-by: Hao A Wu > (cherry picked from commit 248d08c5983b561549891fec54c213e1f354179c) > --- > MdeModulePkg/Library/VarCheckLib/VarCheckLib.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) >=20 > diff --git a/MdeModulePkg/Library/VarCheckLib/VarCheckLib.c > b/MdeModulePkg/Library/VarCheckLib/VarCheckLib.c > index 470d782444bf..9596d760e945 100644 > --- a/MdeModulePkg/Library/VarCheckLib/VarCheckLib.c > +++ b/MdeModulePkg/Library/VarCheckLib/VarCheckLib.c > @@ -1,7 +1,7 @@ > /** @file > Implementation functions and structures for var check services. >=20 > -Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
> +Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -655,6 +655,13 @@ VarCheckLibSetVariableCheck ( > DataSize, > Data > ); > + if (Status =3D=3D EFI_WRITE_PROTECTED && RequestSource =3D=3D > VarCheckFromTrusted) { > + // > + // If RequestSource is trusted, then allow variable to be set eve= n if it > + // is write protected. > + // > + continue; > + } > if (EFI_ERROR (Status)) { > DEBUG ((EFI_D_INFO, "Variable Check handler fail %r - %g:%s\n", > Status, VendorGuid, VariableName)); > return Status; > -- > 2.29.2.windows.2 >=20 >=20 >=20 >=20 >=20