From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 91DF91A1E59 for ; Thu, 8 Sep 2016 19:17:44 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP; 08 Sep 2016 19:17:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,303,1470726000"; d="scan'208";a="876685871" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga003.jf.intel.com with ESMTP; 08 Sep 2016 19:17:44 -0700 Received: from fmsmsx125.amr.corp.intel.com (10.18.125.40) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 8 Sep 2016 19:17:43 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX125.amr.corp.intel.com (10.18.125.40) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 8 Sep 2016 19:16:41 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.109]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.166]) with mapi id 14.03.0248.002; Fri, 9 Sep 2016 10:16:39 +0800 From: "Dong, Eric" To: "Bi, Dandan" , "edk2-devel@lists.01.org" CC: "Gao, Liming" Thread-Topic: [edk2] [patch] MdeModulePkg/HiiDB: Handle the "&READONLY" tag in correctly Thread-Index: AQHSCbDpQOsZrNGQ50aP3Ycm6W6NzaBwbNQQ Date: Fri, 9 Sep 2016 02:16:39 +0000 Message-ID: References: <1473325798-24284-1-git-send-email-dandan.bi@intel.com> In-Reply-To: <1473325798-24284-1-git-send-email-dandan.bi@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [patch] MdeModulePkg/HiiDB: Handle the "&READONLY" tag in correctly X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Sep 2016 02:17:44 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Eric Dong > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Da= ndan Bi > Sent: Thursday, September 08, 2016 5:10 PM > To: edk2-devel@lists.01.org > Cc: Dong, Eric; Gao, Liming > Subject: [edk2] [patch] MdeModulePkg/HiiDB: Handle the "&READONLY" tag in= correctly >=20 > This patch is to fix the incorrect logic when handling the "&READONLY" ta= g > in . > 1. In UEFI spec, the "&READONLY" tag is in upper case, but using the lowe= r > case in current codes by mistake. > 2. The logic in checking the ReadOnly flag is not correct. Whether having > "&READONLY" tag must be consistent with the result of > "ExtractReadOnlyFromOpCode" function. >=20 > Cc: Liming Gao > Cc: Eric Dong > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Dandan Bi > --- > .../Universal/HiiDatabaseDxe/ConfigKeywordHandler.c | 17 +++++++++++= ++---- > 1 file changed, 13 insertions(+), 4 deletions(-) >=20 > diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c > b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c > index 6682319..10a901f 100644 > --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c > +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c > @@ -2905,15 +2905,15 @@ EfiConfigKeywordHandlerSetData ( > goto Done; > } > StringPtr =3D NextStringPtr; >=20 > // > - // 5. Find ReadOnly filter. > + // 5. Find READONLY tag. > // > - if ((StringPtr !=3D NULL) && StrnCmp (StringPtr, L"&ReadOnly", StrLe= n (L"&ReadOnly")) =3D=3D 0) { > + if ((StringPtr !=3D NULL) && StrnCmp (StringPtr, L"&READONLY", StrLe= n (L"&READONLY")) =3D=3D 0) { > ReadOnly =3D TRUE; > - StringPtr +=3D StrLen (L"&ReadOnly"); > + StringPtr +=3D StrLen (L"&READONLY"); > } else { > ReadOnly =3D FALSE; > } >=20 > // > @@ -2935,13 +2935,22 @@ EfiConfigKeywordHandlerSetData ( >=20 > // > // 8. Check the readonly flag. > // > if (ExtractReadOnlyFromOpCode (OpCode) !=3D ReadOnly) { > + // > + // Extracting readonly flag form opcode and extracting "READONLY" = tag form KeywordString should have the same results. > + // If not, the input KeywordString must be incorrect, return the e= rror status to caller. > + // > + *ProgressErr =3D KEYWORD_HANDLER_INCOMPATIBLE_VALUE_DETECTED; > + Status =3D EFI_INVALID_PARAMETER; > + goto Done; > + } > + if (ReadOnly) { > *ProgressErr =3D KEYWORD_HANDLER_ACCESS_NOT_PERMITTED; > Status =3D EFI_ACCESS_DENIED; > - goto Done; > + goto Done; > } >=20 > // > // 9. Merge to the MultiKeywordResp string. > // > -- > 1.9.5.msysgit.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel