[edk2-devel] [PATCH v2 0/1] StandaloneMmCore finds drivers in uncompressed inner fv.

Xu, Wei6 posted 1 patch 6 months ago
Failed in applying to current master (apply log)
There is a newer version of this series
StandaloneMmPkg/Core/FwVol.c | 34 ++++++++++++++++++++++++++--------
1 file changed, 26 insertions(+), 8 deletions(-)
[edk2-devel] [PATCH v2 0/1] StandaloneMmCore finds drivers in uncompressed inner fv.
Posted by Xu, Wei6 6 months ago
V1:
This patch is to fix the issue that StandaloneMmCore fails to detect uncompressed inner FV.
PR: https://github.com/tianocore/edk2/pull/4943

V2:
Based on V1, fix some other issues
1. Add Missing object size checks before casting pointers to header types
  a. InnerFvHeader = (EFI_FIRMWARE_VOLUME_HEADER *)SectionData; 
     This is introduced in V1, add the size check on SectionDataSize against EFI_FIRMWARE_VOLUME_HEADER
  b. Section = (EFI_COMMON_SECTION_HEADER *)(FileHeader + 1);
     Use FfsFindSection instead of FfsFindSectionData to avoid pointer casting.
2. Fix potential memory leak issue that ScratchBuffer is not freed when page allocation for DstBuffer fails.
PR: https://github.com/tianocore/edk2/pull/4965

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Ray Ni <ray.ni@intel.com>

Wei6 Xu (1):
  StandaloneMmPkg: Fix some issues in function MmCoreFfsFindMmDriver.

 StandaloneMmPkg/Core/FwVol.c | 34 ++++++++++++++++++++++++++--------
 1 file changed, 26 insertions(+), 8 deletions(-)

-- 
2.29.2.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110160): https://edk2.groups.io/g/devel/message/110160
Mute This Topic: https://groups.io/mt/102212657/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v2 0/1] StandaloneMmCore finds drivers in uncompressed inner fv.
Posted by Ni, Ray 6 months ago
Wei,
Thanks for fixing the 3 issues.
Can you kindly separate the one patch to at least 2 patches?
One patch is to fix minor issues.
The other is to add support of nested uncompressed FV.

Thanks,
Ray
________________________________
From: Xu, Wei6 <wei6.xu@intel.com>
Sent: Friday, October 27, 2023 8:59 AM
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Xu, Wei6 <wei6.xu@intel.com>; Laszlo Ersek <lersek@redhat.com>; Ard Biesheuvel <ardb+tianocore@kernel.org>; Sami Mujawar <sami.mujawar@arm.com>; Ni, Ray <ray.ni@intel.com>
Subject: [PATCH v2 0/1] StandaloneMmCore finds drivers in uncompressed inner fv.

V1:
This patch is to fix the issue that StandaloneMmCore fails to detect uncompressed inner FV.
PR: https://github.com/tianocore/edk2/pull/4943

V2:
Based on V1, fix some other issues
1. Add Missing object size checks before casting pointers to header types
  a. InnerFvHeader = (EFI_FIRMWARE_VOLUME_HEADER *)SectionData;
     This is introduced in V1, add the size check on SectionDataSize against EFI_FIRMWARE_VOLUME_HEADER
  b. Section = (EFI_COMMON_SECTION_HEADER *)(FileHeader + 1);
     Use FfsFindSection instead of FfsFindSectionData to avoid pointer casting.
2. Fix potential memory leak issue that ScratchBuffer is not freed when page allocation for DstBuffer fails.
PR: https://github.com/tianocore/edk2/pull/4965

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Ray Ni <ray.ni@intel.com>

Wei6 Xu (1):
  StandaloneMmPkg: Fix some issues in function MmCoreFfsFindMmDriver.

 StandaloneMmPkg/Core/FwVol.c | 34 ++++++++++++++++++++++++++--------
 1 file changed, 26 insertions(+), 8 deletions(-)

--
2.29.2.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110189): https://edk2.groups.io/g/devel/message/110189
Mute This Topic: https://groups.io/mt/102212657/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 0/1] StandaloneMmCore finds drivers in uncompressed inner fv.
Posted by Laszlo Ersek 6 months ago
On 10/27/23 07:49, Ni, Ray wrote:
> Wei,
> Thanks for fixing the 3 issues.
> Can you kindly separate the one patch to at least 2 patches?
> One patch is to fix minor issues.
> The other is to add support of nested uncompressed FV.

Yes please!

I'd even prefer a separate patch per individual issue fix (especially if
you count the recursion limiting too).

Thanks!
Laszlo

> 
> Thanks,
> Ray
> ------------------------------------------------------------------------
> *From:* Xu, Wei6 <wei6.xu@intel.com>
> *Sent:* Friday, October 27, 2023 8:59 AM
> *To:* devel@edk2.groups.io <devel@edk2.groups.io>
> *Cc:* Xu, Wei6 <wei6.xu@intel.com>; Laszlo Ersek <lersek@redhat.com>;
> Ard Biesheuvel <ardb+tianocore@kernel.org>; Sami Mujawar
> <sami.mujawar@arm.com>; Ni, Ray <ray.ni@intel.com>
> *Subject:* [PATCH v2 0/1] StandaloneMmCore finds drivers in uncompressed
> inner fv.
>  
> V1:
> This patch is to fix the issue that StandaloneMmCore fails to detect
> uncompressed inner FV.
> PR: https://github.com/tianocore/edk2/pull/4943
> <https://github.com/tianocore/edk2/pull/4943>
> 
> V2:
> Based on V1, fix some other issues
> 1. Add Missing object size checks before casting pointers to header types
>   a. InnerFvHeader = (EFI_FIRMWARE_VOLUME_HEADER *)SectionData;
>      This is introduced in V1, add the size check on SectionDataSize
> against EFI_FIRMWARE_VOLUME_HEADER
>   b. Section = (EFI_COMMON_SECTION_HEADER *)(FileHeader + 1);
>      Use FfsFindSection instead of FfsFindSectionData to avoid pointer
> casting.
> 2. Fix potential memory leak issue that ScratchBuffer is not freed when
> page allocation for DstBuffer fails.
> PR: https://github.com/tianocore/edk2/pull/4965
> <https://github.com/tianocore/edk2/pull/4965>
> 
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Sami Mujawar <sami.mujawar@arm.com>
> Cc: Ray Ni <ray.ni@intel.com>
> 
> Wei6 Xu (1):
>   StandaloneMmPkg: Fix some issues in function MmCoreFfsFindMmDriver.
> 
>  StandaloneMmPkg/Core/FwVol.c | 34 ++++++++++++++++++++++++++--------
>  1 file changed, 26 insertions(+), 8 deletions(-)
> 
> -- 
> 2.29.2.windows.2
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110241): https://edk2.groups.io/g/devel/message/110241
Mute This Topic: https://groups.io/mt/102212657/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 0/1] StandaloneMmCore finds drivers in uncompressed inner fv.
Posted by Xu, Wei6 6 months ago
Hi Laszlo and Ray,

Thanks a lot for the review. Patch V3 is sent out to:
1. Separate patch per individual issue fix
2. Limit FwVol encapsulation section recursion in MmCoreFfsFindMmDriver().
(https://edk2.groups.io/g/devel/message/110296)

Could you please help to review it again? Thanks a lot!

BR,
Wei


-----Original Message-----
From: Laszlo Ersek <lersek@redhat.com> 
Sent: Saturday, October 28, 2023 7:08 PM
To: Ni, Ray <ray.ni@intel.com>; Xu, Wei6 <wei6.xu@intel.com>; devel@edk2.groups.io
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>; Sami Mujawar <sami.mujawar@arm.com>
Subject: Re: [PATCH v2 0/1] StandaloneMmCore finds drivers in uncompressed inner fv.

On 10/27/23 07:49, Ni, Ray wrote:
> Wei,
> Thanks for fixing the 3 issues.
> Can you kindly separate the one patch to at least 2 patches?
> One patch is to fix minor issues.
> The other is to add support of nested uncompressed FV.

Yes please!

I'd even prefer a separate patch per individual issue fix (especially if you count the recursion limiting too).

Thanks!
Laszlo

> 
> Thanks,
> Ray
> ----------------------------------------------------------------------
> --
> *From:* Xu, Wei6 <wei6.xu@intel.com>
> *Sent:* Friday, October 27, 2023 8:59 AM
> *To:* devel@edk2.groups.io <devel@edk2.groups.io>
> *Cc:* Xu, Wei6 <wei6.xu@intel.com>; Laszlo Ersek <lersek@redhat.com>; 
> Ard Biesheuvel <ardb+tianocore@kernel.org>; Sami Mujawar 
> <sami.mujawar@arm.com>; Ni, Ray <ray.ni@intel.com>
> *Subject:* [PATCH v2 0/1] StandaloneMmCore finds drivers in 
> uncompressed inner fv.
>  
> V1:
> This patch is to fix the issue that StandaloneMmCore fails to detect 
> uncompressed inner FV.
> PR: https://github.com/tianocore/edk2/pull/4943
> <https://github.com/tianocore/edk2/pull/4943>
> 
> V2:
> Based on V1, fix some other issues
> 1. Add Missing object size checks before casting pointers to header 
> types
>   a. InnerFvHeader = (EFI_FIRMWARE_VOLUME_HEADER *)SectionData;
>      This is introduced in V1, add the size check on SectionDataSize 
> against EFI_FIRMWARE_VOLUME_HEADER
>   b. Section = (EFI_COMMON_SECTION_HEADER *)(FileHeader + 1);
>      Use FfsFindSection instead of FfsFindSectionData to avoid pointer 
> casting.
> 2. Fix potential memory leak issue that ScratchBuffer is not freed 
> when page allocation for DstBuffer fails.
> PR: https://github.com/tianocore/edk2/pull/4965
> <https://github.com/tianocore/edk2/pull/4965>
> 
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Sami Mujawar <sami.mujawar@arm.com>
> Cc: Ray Ni <ray.ni@intel.com>
> 
> Wei6 Xu (1):
>   StandaloneMmPkg: Fix some issues in function MmCoreFfsFindMmDriver.
> 
>  StandaloneMmPkg/Core/FwVol.c | 34 ++++++++++++++++++++++++++--------
>  1 file changed, 26 insertions(+), 8 deletions(-)
> 
> --
> 2.29.2.windows.2
> 



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