[edk2-devel] [PATCH V2] FmpDevicePkg: GetImageInfo Add missing condition

Pethaiyan Madhan posted 1 patch 3 months, 3 weeks ago
Failed in applying to current master (apply log)
FmpDevicePkg/FmpDxe/FmpDxe.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[edk2-devel] [PATCH V2] FmpDevicePkg: GetImageInfo Add missing condition
Posted by Pethaiyan Madhan 3 months, 3 weeks ago
From: "Pethaiyan, Madhan" <madhan.pethaiyan@intel.com>

UEFI Spec 2.10 , 23.1 Firmware Management Protocol , Added missing condition check under GetImageInfo function,
if the PackageVersionName is NULL return EFI_INVALID_PARAMETER

Signed-off-by: Pethaiyan Madhan <madhan.pethaiyan@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Wei6 Xu <wei6.xu@intel.com>
---
 FmpDevicePkg/FmpDxe/FmpDxe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c b/FmpDevicePkg/FmpDxe/FmpDxe.c
index 1e7ec4a09e..e87094f84c 100644
--- a/FmpDevicePkg/FmpDxe/FmpDxe.c
+++ b/FmpDevicePkg/FmpDxe/FmpDxe.c
@@ -495,7 +495,7 @@ GetTheImageInfo (
   // Confirm that buffer isn't null
   //
   if (  (ImageInfo == NULL) || (DescriptorVersion == NULL) || (DescriptorCount == NULL) || (DescriptorSize == NULL)
-     || (PackageVersion == NULL))
+     || (PackageVersion == NULL) || (PackageVersionName == NULL))
   {
     DEBUG ((DEBUG_ERROR, "FmpDxe(%s): GetImageInfo() - Pointer Parameter is NULL.\n", mImageIdName));
     Status = EFI_INVALID_PARAMETER;
-- 
2.38.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113453): https://edk2.groups.io/g/devel/message/113453
Mute This Topic: https://groups.io/mt/103620853/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH V2] FmpDevicePkg: GetImageInfo Add missing condition
Posted by Pethaiyan, Madhan 3 months, 2 weeks ago
Hi All,

I had corrected the description, added the UEFI spec version and section details . Please check and approve it 

Thanks,
P. Madhan

-----Original Message-----
From: Pethaiyan, Madhan <madhan.pethaiyan@intel.com> 
Sent: Monday, January 8, 2024 12:13 PM
To: devel@edk2.groups.io
Cc: Pethaiyan, Madhan <madhan.pethaiyan@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Kinney, Michael D <michael.d.kinney@intel.com>; Xu, Wei6 <wei6.xu@intel.com>
Subject: [PATCH V2] FmpDevicePkg: GetImageInfo Add missing condition

From: "Pethaiyan, Madhan" <madhan.pethaiyan@intel.com>

UEFI Spec 2.10 , 23.1 Firmware Management Protocol , Added missing condition check under GetImageInfo function, if the PackageVersionName is NULL return EFI_INVALID_PARAMETER

Signed-off-by: Pethaiyan Madhan <madhan.pethaiyan@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Wei6 Xu <wei6.xu@intel.com>
---
 FmpDevicePkg/FmpDxe/FmpDxe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c b/FmpDevicePkg/FmpDxe/FmpDxe.c index 1e7ec4a09e..e87094f84c 100644
--- a/FmpDevicePkg/FmpDxe/FmpDxe.c
+++ b/FmpDevicePkg/FmpDxe/FmpDxe.c
@@ -495,7 +495,7 @@ GetTheImageInfo (
   // Confirm that buffer isn't null
   //
   if (  (ImageInfo == NULL) || (DescriptorVersion == NULL) || (DescriptorCount == NULL) || (DescriptorSize == NULL)
-     || (PackageVersion == NULL))
+     || (PackageVersion == NULL) || (PackageVersionName == NULL))
   {
     DEBUG ((DEBUG_ERROR, "FmpDxe(%s): GetImageInfo() - Pointer Parameter is NULL.\n", mImageIdName));
     Status = EFI_INVALID_PARAMETER;
--
2.38.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114085): https://edk2.groups.io/g/devel/message/114085
Mute This Topic: https://groups.io/mt/103620853/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH V2] FmpDevicePkg: GetImageInfo Add missing condition
Posted by Michael D Kinney 3 months, 2 weeks ago
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>



> -----Original Message-----
> From: Pethaiyan, Madhan <madhan.pethaiyan@intel.com>
> Sent: Thursday, January 18, 2024 12:57 AM
> To: devel@edk2.groups.io
> Cc: Gao, Liming <gaoliming@byosoft.com.cn>; Kinney, Michael D
> <michael.d.kinney@intel.com>; Xu, Wei6 <wei6.xu@intel.com>; Tan, Ming
> <ming.tan@intel.com>; S, Ashraf Ali <ashraf.ali.s@intel.com>
> Subject: RE: [PATCH V2] FmpDevicePkg: GetImageInfo Add missing condition
> 
> Hi All,
> 
> I had corrected the description, added the UEFI spec version and section
> details . Please check and approve it
> 
> Thanks,
> P. Madhan
> 
> -----Original Message-----
> From: Pethaiyan, Madhan <madhan.pethaiyan@intel.com>
> Sent: Monday, January 8, 2024 12:13 PM
> To: devel@edk2.groups.io
> Cc: Pethaiyan, Madhan <madhan.pethaiyan@intel.com>; Gao, Liming
> <gaoliming@byosoft.com.cn>; Kinney, Michael D
> <michael.d.kinney@intel.com>; Xu, Wei6 <wei6.xu@intel.com>
> Subject: [PATCH V2] FmpDevicePkg: GetImageInfo Add missing condition
> 
> From: "Pethaiyan, Madhan" <madhan.pethaiyan@intel.com>
> 
> UEFI Spec 2.10 , 23.1 Firmware Management Protocol , Added missing
> condition check under GetImageInfo function, if the PackageVersionName
> is NULL return EFI_INVALID_PARAMETER
> 
> Signed-off-by: Pethaiyan Madhan <madhan.pethaiyan@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Wei6 Xu <wei6.xu@intel.com>
> ---
>  FmpDevicePkg/FmpDxe/FmpDxe.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c b/FmpDevicePkg/FmpDxe/FmpDxe.c
> index 1e7ec4a09e..e87094f84c 100644
> --- a/FmpDevicePkg/FmpDxe/FmpDxe.c
> +++ b/FmpDevicePkg/FmpDxe/FmpDxe.c
> @@ -495,7 +495,7 @@ GetTheImageInfo (
>    // Confirm that buffer isn't null
>    //
>    if (  (ImageInfo == NULL) || (DescriptorVersion == NULL) ||
> (DescriptorCount == NULL) || (DescriptorSize == NULL)
> -     || (PackageVersion == NULL))
> +     || (PackageVersion == NULL) || (PackageVersionName == NULL))
>    {
>      DEBUG ((DEBUG_ERROR, "FmpDxe(%s): GetImageInfo() - Pointer
> Parameter is NULL.\n", mImageIdName));
>      Status = EFI_INVALID_PARAMETER;
> --
> 2.38.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114009): https://edk2.groups.io/g/devel/message/114009
Mute This Topic: https://groups.io/mt/103620853/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076/xyzzy [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH V2] FmpDevicePkg: GetImageInfo Add missing condition
Posted by Michael D Kinney 3 months, 2 weeks ago
Hi Madhan,

The patch you provided does fix the logic in the .c file, but the update is
incomplete.

* FmpDevicePkg/FmpDxe/FmpDxe.c - Update GetTheImageInfo() function header 
  to match the UEFI 2.10 specification that includes all the conditions to
  return EFI_INVALID_PARAMETER.

* FmpDevicePkg/FmpDxe/FmpDxe.h - Update GetTheImageInfo() function header 
  to match the UEFI 2.10 specification that includes all the conditions to
  return EFI_INVALID_PARAMETER.

* MdePkg/Include/Protocol/FirmwareManagement.h - Update function header
  For EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GET_IMAGE_INFO to match the UEFI 2.10
  specification that includes all the conditions to return EFI_INVALID_PARAMETER.

Also, when trying to search for these, I found that the FmpDxe implementation
uses the function name "GetTheImageInfo()" for the protocol service called
"GetImageInfo()".  I recommend the FmpDxe implementation be updated so the
function name matches the name of the protocol service.

I will wait for a V3 patch set to review as a whole before merging.

Also, the UEFI SCTs would need to be updated for this additional return status.
please enter a Bugzilla and work with the UEFI SCT team to get them updated.

Thanks,

Mike


> -----Original Message-----
> From: Kinney, Michael D <michael.d.kinney@intel.com>
> Sent: Thursday, January 18, 2024 12:03 PM
> To: Pethaiyan, Madhan <madhan.pethaiyan@intel.com>; devel@edk2.groups.io
> Cc: Gao, Liming <gaoliming@byosoft.com.cn>; Xu, Wei6
> <wei6.xu@intel.com>; Tan, Ming <ming.tan@intel.com>; S, Ashraf Ali
> <ashraf.ali.s@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>
> Subject: RE: [PATCH V2] FmpDevicePkg: GetImageInfo Add missing condition
> 
> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
> 
> 
> 
> > -----Original Message-----
> > From: Pethaiyan, Madhan <madhan.pethaiyan@intel.com>
> > Sent: Thursday, January 18, 2024 12:57 AM
> > To: devel@edk2.groups.io
> > Cc: Gao, Liming <gaoliming@byosoft.com.cn>; Kinney, Michael D
> > <michael.d.kinney@intel.com>; Xu, Wei6 <wei6.xu@intel.com>; Tan, Ming
> > <ming.tan@intel.com>; S, Ashraf Ali <ashraf.ali.s@intel.com>
> > Subject: RE: [PATCH V2] FmpDevicePkg: GetImageInfo Add missing
> condition
> >
> > Hi All,
> >
> > I had corrected the description, added the UEFI spec version and
> section
> > details . Please check and approve it
> >
> > Thanks,
> > P. Madhan
> >
> > -----Original Message-----
> > From: Pethaiyan, Madhan <madhan.pethaiyan@intel.com>
> > Sent: Monday, January 8, 2024 12:13 PM
> > To: devel@edk2.groups.io
> > Cc: Pethaiyan, Madhan <madhan.pethaiyan@intel.com>; Gao, Liming
> > <gaoliming@byosoft.com.cn>; Kinney, Michael D
> > <michael.d.kinney@intel.com>; Xu, Wei6 <wei6.xu@intel.com>
> > Subject: [PATCH V2] FmpDevicePkg: GetImageInfo Add missing condition
> >
> > From: "Pethaiyan, Madhan" <madhan.pethaiyan@intel.com>
> >
> > UEFI Spec 2.10 , 23.1 Firmware Management Protocol , Added missing
> > condition check under GetImageInfo function, if the PackageVersionName
> > is NULL return EFI_INVALID_PARAMETER
> >
> > Signed-off-by: Pethaiyan Madhan <madhan.pethaiyan@intel.com>
> > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > Cc: Wei6 Xu <wei6.xu@intel.com>
> > ---
> >  FmpDevicePkg/FmpDxe/FmpDxe.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c
> b/FmpDevicePkg/FmpDxe/FmpDxe.c
> > index 1e7ec4a09e..e87094f84c 100644
> > --- a/FmpDevicePkg/FmpDxe/FmpDxe.c
> > +++ b/FmpDevicePkg/FmpDxe/FmpDxe.c
> > @@ -495,7 +495,7 @@ GetTheImageInfo (
> >    // Confirm that buffer isn't null
> >    //
> >    if (  (ImageInfo == NULL) || (DescriptorVersion == NULL) ||
> > (DescriptorCount == NULL) || (DescriptorSize == NULL)
> > -     || (PackageVersion == NULL))
> > +     || (PackageVersion == NULL) || (PackageVersionName == NULL))
> >    {
> >      DEBUG ((DEBUG_ERROR, "FmpDxe(%s): GetImageInfo() - Pointer
> > Parameter is NULL.\n", mImageIdName));
> >      Status = EFI_INVALID_PARAMETER;
> > --
> > 2.38.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114012): https://edk2.groups.io/g/devel/message/114012
Mute This Topic: https://groups.io/mt/103620853/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076/xyzzy [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH V2] FmpDevicePkg: GetImageInfo Add missing condition
Posted by Michael D Kinney 3 months, 2 weeks ago
Hi Madhan,

There are 2 additional files that need function header updates:

* SignedCapsulePkg\Universal\SystemFirmwareUpdate\SystemFirmwareCommonDxe.c
* SignedCapsulePkg\Universal\SystemFirmwareUpdate\SystemFirmwareDxe.h

In addition, there are function headers in the edk2-platforms repo that 
also need to be updated in separate patch series.

* edk2-platforms\Silicon\Intel\IntelSiliconPkg\Feature\Capsule\MicrocodeUpdateDxe\MicrocodeFmp.c
* edk2-platforms\Silicon\Intel\IntelSiliconPkg\Feature\Capsule\MicrocodeUpdateDxe\MicrocodeUpdate.h

Mike

> -----Original Message-----
> From: Kinney, Michael D <michael.d.kinney@intel.com>
> Sent: Thursday, January 18, 2024 2:30 PM
> To: Pethaiyan, Madhan <madhan.pethaiyan@intel.com>; devel@edk2.groups.io
> Cc: Gao, Liming <gaoliming@byosoft.com.cn>; Xu, Wei6
> <wei6.xu@intel.com>; Tan, Ming <ming.tan@intel.com>; S, Ashraf Ali
> <ashraf.ali.s@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>
> Subject: RE: [PATCH V2] FmpDevicePkg: GetImageInfo Add missing condition
> 
> Hi Madhan,
> 
> The patch you provided does fix the logic in the .c file, but the update
> is
> incomplete.
> 
> * FmpDevicePkg/FmpDxe/FmpDxe.c - Update GetTheImageInfo() function
> header
>   to match the UEFI 2.10 specification that includes all the conditions
> to
>   return EFI_INVALID_PARAMETER.
> 
> * FmpDevicePkg/FmpDxe/FmpDxe.h - Update GetTheImageInfo() function
> header
>   to match the UEFI 2.10 specification that includes all the conditions
> to
>   return EFI_INVALID_PARAMETER.
> 
> * MdePkg/Include/Protocol/FirmwareManagement.h - Update function header
>   For EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GET_IMAGE_INFO to match the UEFI
> 2.10
>   specification that includes all the conditions to return
> EFI_INVALID_PARAMETER.
> 
> Also, when trying to search for these, I found that the FmpDxe
> implementation
> uses the function name "GetTheImageInfo()" for the protocol service
> called
> "GetImageInfo()".  I recommend the FmpDxe implementation be updated so
> the
> function name matches the name of the protocol service.
> 
> I will wait for a V3 patch set to review as a whole before merging.
> 
> Also, the UEFI SCTs would need to be updated for this additional return
> status.
> please enter a Bugzilla and work with the UEFI SCT team to get them
> updated.
> 
> Thanks,
> 
> Mike
> 
> 
> > -----Original Message-----
> > From: Kinney, Michael D <michael.d.kinney@intel.com>
> > Sent: Thursday, January 18, 2024 12:03 PM
> > To: Pethaiyan, Madhan <madhan.pethaiyan@intel.com>;
> devel@edk2.groups.io
> > Cc: Gao, Liming <gaoliming@byosoft.com.cn>; Xu, Wei6
> > <wei6.xu@intel.com>; Tan, Ming <ming.tan@intel.com>; S, Ashraf Ali
> > <ashraf.ali.s@intel.com>; Kinney, Michael D
> <michael.d.kinney@intel.com>
> > Subject: RE: [PATCH V2] FmpDevicePkg: GetImageInfo Add missing
> condition
> >
> > Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
> >
> >
> >
> > > -----Original Message-----
> > > From: Pethaiyan, Madhan <madhan.pethaiyan@intel.com>
> > > Sent: Thursday, January 18, 2024 12:57 AM
> > > To: devel@edk2.groups.io
> > > Cc: Gao, Liming <gaoliming@byosoft.com.cn>; Kinney, Michael D
> > > <michael.d.kinney@intel.com>; Xu, Wei6 <wei6.xu@intel.com>; Tan,
> Ming
> > > <ming.tan@intel.com>; S, Ashraf Ali <ashraf.ali.s@intel.com>
> > > Subject: RE: [PATCH V2] FmpDevicePkg: GetImageInfo Add missing
> > condition
> > >
> > > Hi All,
> > >
> > > I had corrected the description, added the UEFI spec version and
> > section
> > > details . Please check and approve it
> > >
> > > Thanks,
> > > P. Madhan
> > >
> > > -----Original Message-----
> > > From: Pethaiyan, Madhan <madhan.pethaiyan@intel.com>
> > > Sent: Monday, January 8, 2024 12:13 PM
> > > To: devel@edk2.groups.io
> > > Cc: Pethaiyan, Madhan <madhan.pethaiyan@intel.com>; Gao, Liming
> > > <gaoliming@byosoft.com.cn>; Kinney, Michael D
> > > <michael.d.kinney@intel.com>; Xu, Wei6 <wei6.xu@intel.com>
> > > Subject: [PATCH V2] FmpDevicePkg: GetImageInfo Add missing condition
> > >
> > > From: "Pethaiyan, Madhan" <madhan.pethaiyan@intel.com>
> > >
> > > UEFI Spec 2.10 , 23.1 Firmware Management Protocol , Added missing
> > > condition check under GetImageInfo function, if the
> PackageVersionName
> > > is NULL return EFI_INVALID_PARAMETER
> > >
> > > Signed-off-by: Pethaiyan Madhan <madhan.pethaiyan@intel.com>
> > > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > > Cc: Wei6 Xu <wei6.xu@intel.com>
> > > ---
> > >  FmpDevicePkg/FmpDxe/FmpDxe.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c
> > b/FmpDevicePkg/FmpDxe/FmpDxe.c
> > > index 1e7ec4a09e..e87094f84c 100644
> > > --- a/FmpDevicePkg/FmpDxe/FmpDxe.c
> > > +++ b/FmpDevicePkg/FmpDxe/FmpDxe.c
> > > @@ -495,7 +495,7 @@ GetTheImageInfo (
> > >    // Confirm that buffer isn't null
> > >    //
> > >    if (  (ImageInfo == NULL) || (DescriptorVersion == NULL) ||
> > > (DescriptorCount == NULL) || (DescriptorSize == NULL)
> > > -     || (PackageVersion == NULL))
> > > +     || (PackageVersion == NULL) || (PackageVersionName == NULL))
> > >    {
> > >      DEBUG ((DEBUG_ERROR, "FmpDxe(%s): GetImageInfo() - Pointer
> > > Parameter is NULL.\n", mImageIdName));
> > >      Status = EFI_INVALID_PARAMETER;
> > > --
> > > 2.38.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114013): https://edk2.groups.io/g/devel/message/114013
Mute This Topic: https://groups.io/mt/103620853/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076/xyzzy [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-