From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 83A471A1DF1 for ; Sun, 11 Sep 2016 19:29:31 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP; 11 Sep 2016 19:29:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,320,1470726000"; d="scan'208";a="7669237" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga004.jf.intel.com with ESMTP; 11 Sep 2016 19:29:30 -0700 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 11 Sep 2016 19:29:30 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 11 Sep 2016 19:29:30 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.109]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.102]) with mapi id 14.03.0248.002; Mon, 12 Sep 2016 10:29:28 +0800 From: "Gao, Liming" To: "Bi, Dandan" , "edk2-devel@lists.01.org" CC: "Dong, Eric" Thread-Topic: [edk2] [patch] MdeModulePkg/HiiDB: Handle the "&READONLY" tag in correctly Thread-Index: AQHSCbDp3JTzYeCbaUqSGvt4QEHwVaB1J4ng Date: Mon, 12 Sep 2016 02:29:28 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14B3E6C8D@shsmsx102.ccr.corp.intel.com> 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: Mon, 12 Sep 2016 02:29:31 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Dandan 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