[edk2] [PATCH] MdeModulePkg PeiCore: Check error status when processing boot FV

Marcin Wojtas posted 1 patch 4 years ago
Failed in applying to current master (apply log)
MdeModulePkg/Core/Pei/FwVol/FwVol.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
[edk2] [PATCH] MdeModulePkg PeiCore: Check error status when processing boot FV
Posted by Marcin Wojtas 4 years ago
Until now the possible errors returned from processing
boot firmware volume were not checked, which could cause
misbehavior in further booting stages. Add relevant assert.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Signed-off-by: Jan Dabros <jsd@semihalf.com>
---
 MdeModulePkg/Core/Pei/FwVol/FwVol.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.c b/MdeModulePkg/Core/Pei/FwVol/FwVol.c
index 8009546..4150b33 100644
--- a/MdeModulePkg/Core/Pei/FwVol/FwVol.c
+++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.c
@@ -495,12 +495,13 @@ PeiInitializeFv (
   //
   // Get handle of BFV
   //
-  FvPpi->ProcessVolume (
-           FvPpi, 
-           SecCoreData->BootFirmwareVolumeBase,
-           (UINTN)BfvHeader->FvLength,
-           &FvHandle
-           );
+  Status = FvPpi->ProcessVolume (
+                    FvPpi,
+                    SecCoreData->BootFirmwareVolumeBase,
+                    (UINTN)BfvHeader->FvLength,
+                    &FvHandle
+                    );
+  ASSERT_EFI_ERROR (Status);
 
   //
   // Update internal PEI_CORE_FV array.
-- 
2.7.4

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH] MdeModulePkg PeiCore: Check error status when processing boot FV
Posted by Ard Biesheuvel 4 years ago
(+ MdeModulePkg maintainers)

On 1 June 2018 at 15:58, Marcin Wojtas <mw@semihalf.com> wrote:
> Until now the possible errors returned from processing
> boot firmware volume were not checked, which could cause
> misbehavior in further booting stages. Add relevant assert.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Marcin Wojtas <mw@semihalf.com>
> Signed-off-by: Jan Dabros <jsd@semihalf.com>
> ---
>  MdeModulePkg/Core/Pei/FwVol/FwVol.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.c b/MdeModulePkg/Core/Pei/FwVol/FwVol.c
> index 8009546..4150b33 100644
> --- a/MdeModulePkg/Core/Pei/FwVol/FwVol.c
> +++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.c
> @@ -495,12 +495,13 @@ PeiInitializeFv (
>    //
>    // Get handle of BFV
>    //
> -  FvPpi->ProcessVolume (
> -           FvPpi,
> -           SecCoreData->BootFirmwareVolumeBase,
> -           (UINTN)BfvHeader->FvLength,
> -           &FvHandle
> -           );
> +  Status = FvPpi->ProcessVolume (
> +                    FvPpi,
> +                    SecCoreData->BootFirmwareVolumeBase,
> +                    (UINTN)BfvHeader->FvLength,
> +                    &FvHandle
> +                    );
> +  ASSERT_EFI_ERROR (Status);
>
>    //
>    // Update internal PEI_CORE_FV array.
> --
> 2.7.4
>
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH] MdeModulePkg PeiCore: Check error status when processing boot FV
Posted by Zeng, Star 4 years ago
Reviewed-by: Star Zeng <star.zeng@intel.com>
Pushed at 38c977c148e92e2af17c5d346d9b4b2e7a18680a.


Thanks,
Star
-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ard Biesheuvel
Sent: Friday, June 1, 2018 10:00 PM
To: Marcin Wojtas <mw@semihalf.com>; Zeng, Star <star.zeng@intel.com>; Dong, Eric <eric.dong@intel.com>
Cc: Tian, Feng <feng.tian@intel.com>; edk2-devel@lists.01.org; Leif Lindholm <leif.lindholm@linaro.org>; Gao, Liming <liming.gao@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>
Subject: Re: [edk2] [PATCH] MdeModulePkg PeiCore: Check error status when processing boot FV

(+ MdeModulePkg maintainers)

On 1 June 2018 at 15:58, Marcin Wojtas <mw@semihalf.com> wrote:
> Until now the possible errors returned from processing boot firmware 
> volume were not checked, which could cause misbehavior in further 
> booting stages. Add relevant assert.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Marcin Wojtas <mw@semihalf.com>
> Signed-off-by: Jan Dabros <jsd@semihalf.com>
> ---
>  MdeModulePkg/Core/Pei/FwVol/FwVol.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.c 
> b/MdeModulePkg/Core/Pei/FwVol/FwVol.c
> index 8009546..4150b33 100644
> --- a/MdeModulePkg/Core/Pei/FwVol/FwVol.c
> +++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.c
> @@ -495,12 +495,13 @@ PeiInitializeFv (
>    //
>    // Get handle of BFV
>    //
> -  FvPpi->ProcessVolume (
> -           FvPpi,
> -           SecCoreData->BootFirmwareVolumeBase,
> -           (UINTN)BfvHeader->FvLength,
> -           &FvHandle
> -           );
> +  Status = FvPpi->ProcessVolume (
> +                    FvPpi,
> +                    SecCoreData->BootFirmwareVolumeBase,
> +                    (UINTN)BfvHeader->FvLength,
> +                    &FvHandle
> +                    );
> +  ASSERT_EFI_ERROR (Status);
>
>    //
>    // Update internal PEI_CORE_FV array.
> --
> 2.7.4
>
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH] MdeModulePkg PeiCore: Check error status when processing boot FV
Posted by Gao, Liming 4 years ago
I agree to add this checker. 

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

> -----Original Message-----
> From: Marcin Wojtas [mailto:mw@semihalf.com]
> Sent: Friday, June 1, 2018 9:58 PM
> To: edk2-devel@lists.01.org
> Cc: Tian, Feng <feng.tian@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming <liming.gao@intel.com>;
> leif.lindholm@linaro.org; ard.biesheuvel@linaro.org; jsd@semihalf.com; Marcin Wojtas <mw@semihalf.com>
> Subject: [PATCH] MdeModulePkg PeiCore: Check error status when processing boot FV
> 
> Until now the possible errors returned from processing
> boot firmware volume were not checked, which could cause
> misbehavior in further booting stages. Add relevant assert.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Marcin Wojtas <mw@semihalf.com>
> Signed-off-by: Jan Dabros <jsd@semihalf.com>
> ---
>  MdeModulePkg/Core/Pei/FwVol/FwVol.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.c b/MdeModulePkg/Core/Pei/FwVol/FwVol.c
> index 8009546..4150b33 100644
> --- a/MdeModulePkg/Core/Pei/FwVol/FwVol.c
> +++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.c
> @@ -495,12 +495,13 @@ PeiInitializeFv (
>    //
>    // Get handle of BFV
>    //
> -  FvPpi->ProcessVolume (
> -           FvPpi,
> -           SecCoreData->BootFirmwareVolumeBase,
> -           (UINTN)BfvHeader->FvLength,
> -           &FvHandle
> -           );
> +  Status = FvPpi->ProcessVolume (
> +                    FvPpi,
> +                    SecCoreData->BootFirmwareVolumeBase,
> +                    (UINTN)BfvHeader->FvLength,
> +                    &FvHandle
> +                    );
> +  ASSERT_EFI_ERROR (Status);
> 
>    //
>    // Update internal PEI_CORE_FV array.
> --
> 2.7.4

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