public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [patch] MdeModulePkg/HiiDB: Fix incorrect structure convention for checkbox
@ 2018-10-08  1:29 Dandan Bi
  2018-10-08  3:08 ` Gao, Liming
  2018-10-08 12:18 ` Laszlo Ersek
  0 siblings, 2 replies; 7+ messages in thread
From: Dandan Bi @ 2018-10-08  1:29 UTC (permalink / raw)
  To: edk2-devel; +Cc: Liming Gao, Star Zeng

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1224

When covert IFR binary to EFI_IFR_CHECKBOX structure,
Current code has following incorrect code logic:
IfrCheckBox = (EFI_IFR_CHECKBOX *) (IfrOpHdr + 1);
The correct one should be:
IfrCheckBox = (EFI_IFR_CHECKBOX *) IfrOpHdr;

This patch is to fix this bug.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
 MdeModulePkg/Universal/HiiDatabaseDxe/Database.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
index 45448c5198..664687796f 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
@@ -896,11 +896,11 @@ UpdateDefaultSettingInFormPackage (
       break;
     case EFI_IFR_CHECKBOX_OP:
       IfrScope         = IfrOpHdr->Scope;
       IfrQuestionType  = IfrOpHdr->OpCode;
       IfrQuestionHdr   = (EFI_IFR_QUESTION_HEADER *) (IfrOpHdr + 1);
-      IfrCheckBox      = (EFI_IFR_CHECKBOX *) (IfrOpHdr + 1);
+      IfrCheckBox      = (EFI_IFR_CHECKBOX *) IfrOpHdr;
       EfiVarStoreIndex = IsEfiVarStoreQuestion (IfrQuestionHdr, EfiVarStoreList, EfiVarStoreNumber);
       Width            = sizeof (BOOLEAN);
       if (EfiVarStoreIndex < EfiVarStoreNumber) {
         for (Index = 0; Index < DefaultIdNumber; Index ++) {
           if (DefaultIdList[Index] == EFI_HII_DEFAULT_CLASS_STANDARD) {
-- 
2.18.0.windows.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [patch] MdeModulePkg/HiiDB: Fix incorrect structure convention for checkbox
  2018-10-08  1:29 [patch] MdeModulePkg/HiiDB: Fix incorrect structure convention for checkbox Dandan Bi
@ 2018-10-08  3:08 ` Gao, Liming
  2018-10-08 12:18 ` Laszlo Ersek
  1 sibling, 0 replies; 7+ messages in thread
From: Gao, Liming @ 2018-10-08  3:08 UTC (permalink / raw)
  To: Bi, Dandan, edk2-devel@lists.01.org; +Cc: Zeng, Star

Reviewed-by: Liming Gao <liming.gao@intel.com>

>-----Original Message-----
>From: Bi, Dandan
>Sent: Monday, October 08, 2018 9:29 AM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming <liming.gao@intel.com>; Zeng, Star <star.zeng@intel.com>
>Subject: [patch] MdeModulePkg/HiiDB: Fix incorrect structure convention for
>checkbox
>
>REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1224
>
>When covert IFR binary to EFI_IFR_CHECKBOX structure,
>Current code has following incorrect code logic:
>IfrCheckBox = (EFI_IFR_CHECKBOX *) (IfrOpHdr + 1);
>The correct one should be:
>IfrCheckBox = (EFI_IFR_CHECKBOX *) IfrOpHdr;
>
>This patch is to fix this bug.
>
>Cc: Liming Gao <liming.gao@intel.com>
>Cc: Star Zeng <star.zeng@intel.com>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Dandan Bi <dandan.bi@intel.com>
>---
> MdeModulePkg/Universal/HiiDatabaseDxe/Database.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
>b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
>index 45448c5198..664687796f 100644
>--- a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
>+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
>@@ -896,11 +896,11 @@ UpdateDefaultSettingInFormPackage (
>       break;
>     case EFI_IFR_CHECKBOX_OP:
>       IfrScope         = IfrOpHdr->Scope;
>       IfrQuestionType  = IfrOpHdr->OpCode;
>       IfrQuestionHdr   = (EFI_IFR_QUESTION_HEADER *) (IfrOpHdr + 1);
>-      IfrCheckBox      = (EFI_IFR_CHECKBOX *) (IfrOpHdr + 1);
>+      IfrCheckBox      = (EFI_IFR_CHECKBOX *) IfrOpHdr;
>       EfiVarStoreIndex = IsEfiVarStoreQuestion (IfrQuestionHdr, EfiVarStoreList,
>EfiVarStoreNumber);
>       Width            = sizeof (BOOLEAN);
>       if (EfiVarStoreIndex < EfiVarStoreNumber) {
>         for (Index = 0; Index < DefaultIdNumber; Index ++) {
>           if (DefaultIdList[Index] == EFI_HII_DEFAULT_CLASS_STANDARD) {
>--
>2.18.0.windows.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [patch] MdeModulePkg/HiiDB: Fix incorrect structure convention for checkbox
  2018-10-08  1:29 [patch] MdeModulePkg/HiiDB: Fix incorrect structure convention for checkbox Dandan Bi
  2018-10-08  3:08 ` Gao, Liming
@ 2018-10-08 12:18 ` Laszlo Ersek
  2018-10-08 14:32   ` Bi, Dandan
  1 sibling, 1 reply; 7+ messages in thread
From: Laszlo Ersek @ 2018-10-08 12:18 UTC (permalink / raw)
  To: Dandan Bi, edk2-devel; +Cc: Star Zeng, Liming Gao

Hi Dandan,

On 10/08/18 03:29, Dandan Bi wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1224
> 
> When covert IFR binary to EFI_IFR_CHECKBOX structure,
> Current code has following incorrect code logic:
> IfrCheckBox = (EFI_IFR_CHECKBOX *) (IfrOpHdr + 1);
> The correct one should be:
> IfrCheckBox = (EFI_IFR_CHECKBOX *) IfrOpHdr;
> 
> This patch is to fix this bug.
> 
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Star Zeng <star.zeng@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Dandan Bi <dandan.bi@intel.com>
> ---
>  MdeModulePkg/Universal/HiiDatabaseDxe/Database.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
> index 45448c5198..664687796f 100644
> --- a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
> +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
> @@ -896,11 +896,11 @@ UpdateDefaultSettingInFormPackage (
>        break;
>      case EFI_IFR_CHECKBOX_OP:
>        IfrScope         = IfrOpHdr->Scope;
>        IfrQuestionType  = IfrOpHdr->OpCode;
>        IfrQuestionHdr   = (EFI_IFR_QUESTION_HEADER *) (IfrOpHdr + 1);
> -      IfrCheckBox      = (EFI_IFR_CHECKBOX *) (IfrOpHdr + 1);
> +      IfrCheckBox      = (EFI_IFR_CHECKBOX *) IfrOpHdr;
>        EfiVarStoreIndex = IsEfiVarStoreQuestion (IfrQuestionHdr, EfiVarStoreList, EfiVarStoreNumber);
>        Width            = sizeof (BOOLEAN);
>        if (EfiVarStoreIndex < EfiVarStoreNumber) {
>          for (Index = 0; Index < DefaultIdNumber; Index ++) {
>            if (DefaultIdList[Index] == EFI_HII_DEFAULT_CLASS_STANDARD) {
> 

what were the practical consequences (symptoms) of this issue? Did some
checkboxes not work? (I'm asking because SecureBootConfigDxe uses some
checkboxes.)

Thanks,
Laszlo


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [patch] MdeModulePkg/HiiDB: Fix incorrect structure convention for checkbox
  2018-10-08 12:18 ` Laszlo Ersek
@ 2018-10-08 14:32   ` Bi, Dandan
  2018-10-08 15:15     ` Laszlo Ersek
  0 siblings, 1 reply; 7+ messages in thread
From: Bi, Dandan @ 2018-10-08 14:32 UTC (permalink / raw)
  To: Laszlo Ersek, edk2-devel@lists.01.org; +Cc: Zeng, Star, Gao, Liming, Bi, Dandan

Hi Laszlo,

> -----Original Message-----
> From: Laszlo Ersek [mailto:lersek@redhat.com]
> Sent: Monday, October 08, 2018 8:19 PM
> To: Bi, Dandan <dandan.bi@intel.com>; edk2-devel@lists.01.org
> Cc: Zeng, Star <star.zeng@intel.com>; Gao, Liming <liming.gao@intel.com>
> Subject: Re: [edk2] [patch] MdeModulePkg/HiiDB: Fix incorrect structure
> convention for checkbox
> 
> Hi Dandan,
> 
> On 10/08/18 03:29, Dandan Bi wrote:
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1224
> >
> > When covert IFR binary to EFI_IFR_CHECKBOX structure, Current code has
> > following incorrect code logic:
> > IfrCheckBox = (EFI_IFR_CHECKBOX *) (IfrOpHdr + 1); The correct one
> > should be:
> > IfrCheckBox = (EFI_IFR_CHECKBOX *) IfrOpHdr;
> >
> > This patch is to fix this bug.
> >
> > Cc: Liming Gao <liming.gao@intel.com>
> > Cc: Star Zeng <star.zeng@intel.com>
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Dandan Bi <dandan.bi@intel.com>
> > ---
> >  MdeModulePkg/Universal/HiiDatabaseDxe/Database.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
> > b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
> > index 45448c5198..664687796f 100644
> > --- a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
> > +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
> > @@ -896,11 +896,11 @@ UpdateDefaultSettingInFormPackage (
> >        break;
> >      case EFI_IFR_CHECKBOX_OP:
> >        IfrScope         = IfrOpHdr->Scope;
> >        IfrQuestionType  = IfrOpHdr->OpCode;
> >        IfrQuestionHdr   = (EFI_IFR_QUESTION_HEADER *) (IfrOpHdr + 1);
> > -      IfrCheckBox      = (EFI_IFR_CHECKBOX *) (IfrOpHdr + 1);
> > +      IfrCheckBox      = (EFI_IFR_CHECKBOX *) IfrOpHdr;
> >        EfiVarStoreIndex = IsEfiVarStoreQuestion (IfrQuestionHdr,
> EfiVarStoreList, EfiVarStoreNumber);
> >        Width            = sizeof (BOOLEAN);
> >        if (EfiVarStoreIndex < EfiVarStoreNumber) {
> >          for (Index = 0; Index < DefaultIdNumber; Index ++) {
> >            if (DefaultIdList[Index] == EFI_HII_DEFAULT_CLASS_STANDARD)
> > {
> >
> 
> what were the practical consequences (symptoms) of this issue? Did some
> checkboxes not work? (I'm asking because SecureBootConfigDxe uses some
> checkboxes.)

1.  The bug is in function "UpdateDefaultSettingInFormPackage()" which is to update the default setting of some HII Questions in the IFR binary data. So it only has impact when platform overrides default setting in HII VarStore through DynamicHii PCD setting in Platform DSC file. If platform doesn't override default setting, it has no impact.

2. The implementation updates the "Flags" filed in the EFI_IFR_CHECKBOX structure to update the default setting of checkbox.
If using "IfrCheckBox      = (EFI_IFR_CHECKBOX *) (IfrOpHdr + 1);" when wants to update the " Flags" filed in checkbox, but in fact it will update the opcode binary data(opcode binary length) behind checkbox binary. 
And then it will cause Browser can't parse the IFR binary data correctly. And then the possible symptom is that some HII Question and forms may be not parsed and then cannot be shown.


Thanks,
Dandan

> 
> Thanks,
> Laszlo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [patch] MdeModulePkg/HiiDB: Fix incorrect structure convention for checkbox
  2018-10-08 14:32   ` Bi, Dandan
@ 2018-10-08 15:15     ` Laszlo Ersek
  2018-10-09  2:06       ` Ni, Ruiyu
  0 siblings, 1 reply; 7+ messages in thread
From: Laszlo Ersek @ 2018-10-08 15:15 UTC (permalink / raw)
  To: Bi, Dandan, edk2-devel@lists.01.org; +Cc: Zeng, Star, Gao, Liming

On 10/08/18 16:32, Bi, Dandan wrote:
> Hi Laszlo,
> 
>> -----Original Message-----
>> From: Laszlo Ersek [mailto:lersek@redhat.com]
>> Sent: Monday, October 08, 2018 8:19 PM
>> To: Bi, Dandan <dandan.bi@intel.com>; edk2-devel@lists.01.org
>> Cc: Zeng, Star <star.zeng@intel.com>; Gao, Liming <liming.gao@intel.com>
>> Subject: Re: [edk2] [patch] MdeModulePkg/HiiDB: Fix incorrect structure
>> convention for checkbox
>>
>> Hi Dandan,
>>
>> On 10/08/18 03:29, Dandan Bi wrote:
>>> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1224
>>>
>>> When covert IFR binary to EFI_IFR_CHECKBOX structure, Current code has
>>> following incorrect code logic:
>>> IfrCheckBox = (EFI_IFR_CHECKBOX *) (IfrOpHdr + 1); The correct one
>>> should be:
>>> IfrCheckBox = (EFI_IFR_CHECKBOX *) IfrOpHdr;
>>>
>>> This patch is to fix this bug.
>>>
>>> Cc: Liming Gao <liming.gao@intel.com>
>>> Cc: Star Zeng <star.zeng@intel.com>
>>> Contributed-under: TianoCore Contribution Agreement 1.1
>>> Signed-off-by: Dandan Bi <dandan.bi@intel.com>
>>> ---
>>>  MdeModulePkg/Universal/HiiDatabaseDxe/Database.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
>>> b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
>>> index 45448c5198..664687796f 100644
>>> --- a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
>>> +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
>>> @@ -896,11 +896,11 @@ UpdateDefaultSettingInFormPackage (
>>>        break;
>>>      case EFI_IFR_CHECKBOX_OP:
>>>        IfrScope         = IfrOpHdr->Scope;
>>>        IfrQuestionType  = IfrOpHdr->OpCode;
>>>        IfrQuestionHdr   = (EFI_IFR_QUESTION_HEADER *) (IfrOpHdr + 1);
>>> -      IfrCheckBox      = (EFI_IFR_CHECKBOX *) (IfrOpHdr + 1);
>>> +      IfrCheckBox      = (EFI_IFR_CHECKBOX *) IfrOpHdr;
>>>        EfiVarStoreIndex = IsEfiVarStoreQuestion (IfrQuestionHdr,
>> EfiVarStoreList, EfiVarStoreNumber);
>>>        Width            = sizeof (BOOLEAN);
>>>        if (EfiVarStoreIndex < EfiVarStoreNumber) {
>>>          for (Index = 0; Index < DefaultIdNumber; Index ++) {
>>>            if (DefaultIdList[Index] == EFI_HII_DEFAULT_CLASS_STANDARD)
>>> {
>>>
>>
>> what were the practical consequences (symptoms) of this issue? Did some
>> checkboxes not work? (I'm asking because SecureBootConfigDxe uses some
>> checkboxes.)
> 
> 1.  The bug is in function "UpdateDefaultSettingInFormPackage()" which is to update the default setting of some HII Questions in the IFR binary data. So it only has impact when platform overrides default setting in HII VarStore through DynamicHii PCD setting in Platform DSC file. If platform doesn't override default setting, it has no impact.
> 
> 2. The implementation updates the "Flags" filed in the EFI_IFR_CHECKBOX structure to update the default setting of checkbox.
> If using "IfrCheckBox      = (EFI_IFR_CHECKBOX *) (IfrOpHdr + 1);" when wants to update the " Flags" filed in checkbox, but in fact it will update the opcode binary data(opcode binary length) behind checkbox binary. 
> And then it will cause Browser can't parse the IFR binary data correctly. And then the possible symptom is that some HII Question and forms may be not parsed and then cannot be shown.

Thanks! I've copied this into the BZ.

Laszlo


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [patch] MdeModulePkg/HiiDB: Fix incorrect structure convention for checkbox
  2018-10-08 15:15     ` Laszlo Ersek
@ 2018-10-09  2:06       ` Ni, Ruiyu
  2018-10-09  2:13         ` Bi, Dandan
  0 siblings, 1 reply; 7+ messages in thread
From: Ni, Ruiyu @ 2018-10-09  2:06 UTC (permalink / raw)
  To: Laszlo Ersek, Bi, Dandan, edk2-devel@lists.01.org; +Cc: Gao, Liming, Zeng, Star

On 10/8/2018 11:15 PM, Laszlo Ersek wrote:
> On 10/08/18 16:32, Bi, Dandan wrote:
>>>
>>> what were the practical consequences (symptoms) of this issue? Did some
>>> checkboxes not work? (I'm asking because SecureBootConfigDxe uses some
>>> checkboxes.)
>>
>> 1.  The bug is in function "UpdateDefaultSettingInFormPackage()" which is to update the default setting of some HII Questions in the IFR binary data. So it only has impact when platform overrides default setting in HII VarStore through DynamicHii PCD setting in Platform DSC file. If platform doesn't override default setting, it has no impact.
>>
>> 2. The implementation updates the "Flags" filed in the EFI_IFR_CHECKBOX structure to update the default setting of checkbox.
>> If using "IfrCheckBox      = (EFI_IFR_CHECKBOX *) (IfrOpHdr + 1);" when wants to update the " Flags" filed in checkbox, but in fact it will update the opcode binary data(opcode binary length) behind checkbox binary.
>> And then it will cause Browser can't parse the IFR binary data correctly. And then the possible symptom is that some HII Question and forms may be not parsed and then cannot be shown.
> 
> Thanks! I've copied this into the BZ.

Has this patch been pushed? If not, maybe you could also copy the above 
description in the commit message.
A commit message that describes what to be fixed is more meaningful.

> 
> Laszlo
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
> 


-- 
Thanks,
Ray


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [patch] MdeModulePkg/HiiDB: Fix incorrect structure convention for checkbox
  2018-10-09  2:06       ` Ni, Ruiyu
@ 2018-10-09  2:13         ` Bi, Dandan
  0 siblings, 0 replies; 7+ messages in thread
From: Bi, Dandan @ 2018-10-09  2:13 UTC (permalink / raw)
  To: Ni, Ruiyu, Laszlo Ersek, edk2-devel@lists.01.org; +Cc: Gao, Liming, Zeng, Star

> -----Original Message-----
> From: Ni, Ruiyu
> Sent: Tuesday, October 9, 2018 10:07 AM
> To: Laszlo Ersek <lersek@redhat.com>; Bi, Dandan <dandan.bi@intel.com>;
> edk2-devel@lists.01.org
> Cc: Gao, Liming <liming.gao@intel.com>; Zeng, Star <star.zeng@intel.com>
> Subject: Re: [edk2] [patch] MdeModulePkg/HiiDB: Fix incorrect structure
> convention for checkbox
> 
> On 10/8/2018 11:15 PM, Laszlo Ersek wrote:
> > On 10/08/18 16:32, Bi, Dandan wrote:
> >>>
> >>> what were the practical consequences (symptoms) of this issue? Did
> >>> some checkboxes not work? (I'm asking because SecureBootConfigDxe
> >>> uses some
> >>> checkboxes.)
> >>
> >> 1.  The bug is in function "UpdateDefaultSettingInFormPackage()" which is
> to update the default setting of some HII Questions in the IFR binary data. So
> it only has impact when platform overrides default setting in HII VarStore
> through DynamicHii PCD setting in Platform DSC file. If platform doesn't
> override default setting, it has no impact.
> >>
> >> 2. The implementation updates the "Flags" filed in the EFI_IFR_CHECKBOX
> structure to update the default setting of checkbox.
> >> If using "IfrCheckBox      = (EFI_IFR_CHECKBOX *) (IfrOpHdr + 1);" when
> wants to update the " Flags" filed in checkbox, but in fact it will update the
> opcode binary data(opcode binary length) behind checkbox binary.
> >> And then it will cause Browser can't parse the IFR binary data correctly.
> And then the possible symptom is that some HII Question and forms may be
> not parsed and then cannot be shown.
> >
> > Thanks! I've copied this into the BZ.
> 
> Has this patch been pushed? If not, maybe you could also copy the above
> description in the commit message.
> A commit message that describes what to be fixed is more meaningful.

Not yet. And I will copy the description in the commit message before push the patch.
> 
> >
> > Laszlo
> > _______________________________________________
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
> >
> 
> 
> --
> Thanks,
> Ray

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-10-09  2:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-08  1:29 [patch] MdeModulePkg/HiiDB: Fix incorrect structure convention for checkbox Dandan Bi
2018-10-08  3:08 ` Gao, Liming
2018-10-08 12:18 ` Laszlo Ersek
2018-10-08 14:32   ` Bi, Dandan
2018-10-08 15:15     ` Laszlo Ersek
2018-10-09  2:06       ` Ni, Ruiyu
2018-10-09  2:13         ` Bi, Dandan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox