public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch MdeModulePkg/Library v1 0/1] Fix exception issue while UsbMass block io uninstalled
@ 2019-03-19 12:59 Ming Huang
  2019-03-19 12:59 ` [Patch MdeModulePkg/Library v1 1/1] MdeModulePkg/UefiBootManangerLib: Fix exception issue Ming Huang
  0 siblings, 1 reply; 4+ messages in thread
From: Ming Huang @ 2019-03-19 12:59 UTC (permalink / raw)
  To: linaro-uefi, edk2-devel, hao.a.wu, michael.d.kinney, liming.gao
  Cc: leif.lindholm, ard.biesheuvel, wanghuiqiang, huangming23,
	zhangjinsong2, mengfanrong, huangdaode, Ming Huang

The Bugzilla tracker for this:
https://bugzilla.tianocore.org/show_bug.cgi?id=1631

Ming Huang (1):
  MdeModulePkg/UefiBootManangerLib: Fix exception issue

 MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 3 +++
 1 file changed, 3 insertions(+)

-- 
2.9.5



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

* [Patch MdeModulePkg/Library v1 1/1] MdeModulePkg/UefiBootManangerLib: Fix exception issue
  2019-03-19 12:59 [Patch MdeModulePkg/Library v1 0/1] Fix exception issue while UsbMass block io uninstalled Ming Huang
@ 2019-03-19 12:59 ` Ming Huang
  2019-03-19 13:46   ` Leif Lindholm
  0 siblings, 1 reply; 4+ messages in thread
From: Ming Huang @ 2019-03-19 12:59 UTC (permalink / raw)
  To: linaro-uefi, edk2-devel, hao.a.wu, michael.d.kinney, liming.gao
  Cc: leif.lindholm, ard.biesheuvel, wanghuiqiang, huangming23,
	zhangjinsong2, mengfanrong, huangdaode, Ming Huang

The system environment: virtual-CDROM(USB interface) via BMC, insert a
iso file to CDROM, like ubuntu-18.04.1-server-arm64.iso, change CDROM
to first boot option.
With release version bios, disconnecting CDROM when boot to
"1 seconds left, Press Esc or F2 to enter Setup"
then system will get a exception.

The root cause is the EFI_BLOCK_IO_PROTOCOL for UsbMass will be uninstalled
in this situation after print some transfer error. The status will be
invalid parameter. This line will get a exception for BlockIo not point
to right address:
AllocatePool (BlockIo->Media->BlockSize)
So, here need to judge the status after ASSERT_EFI_ERROR.

The Bugzilla tracker for this:
https://bugzilla.tianocore.org/show_bug.cgi?id=1631

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ming Huang <ming.huang@linaro.org>
---
 MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
index 4ce83ce22d61..0535cd7335b4 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
@@ -1069,6 +1069,9 @@ BmExpandMediaDevicePath (
   //
   Status = gBS->HandleProtocol (Handle, &gEfiBlockIoProtocolGuid, (VOID **) &BlockIo);
   ASSERT_EFI_ERROR (Status);
+  if (EFI_ERROR (Status)) {
+    return NULL;
+  }
   Buffer = AllocatePool (BlockIo->Media->BlockSize);
   if (Buffer != NULL) {
     BlockIo->ReadBlocks (
-- 
2.9.5



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

* Re: [Patch MdeModulePkg/Library v1 1/1] MdeModulePkg/UefiBootManangerLib: Fix exception issue
  2019-03-19 12:59 ` [Patch MdeModulePkg/Library v1 1/1] MdeModulePkg/UefiBootManangerLib: Fix exception issue Ming Huang
@ 2019-03-19 13:46   ` Leif Lindholm
  2019-03-21  1:12     ` Wu, Hao A
  0 siblings, 1 reply; 4+ messages in thread
From: Leif Lindholm @ 2019-03-19 13:46 UTC (permalink / raw)
  To: Ming Huang
  Cc: linaro-uefi, edk2-devel, hao.a.wu, michael.d.kinney, liming.gao,
	ard.biesheuvel, wanghuiqiang, huangming23, zhangjinsong2,
	mengfanrong, huangdaode

Thanks, Ming.

On Tue, Mar 19, 2019 at 08:59:13PM +0800, Ming Huang wrote:
> The system environment: virtual-CDROM(USB interface) via BMC, insert a
> iso file to CDROM, like ubuntu-18.04.1-server-arm64.iso, change CDROM
> to first boot option.
> With release version bios, disconnecting CDROM when boot to
> "1 seconds left, Press Esc or F2 to enter Setup"
> then system will get a exception.
> 
> The root cause is the EFI_BLOCK_IO_PROTOCOL for UsbMass will be uninstalled
> in this situation after print some transfer error. The status will be
> invalid parameter. This line will get a exception for BlockIo not point
> to right address:
> AllocatePool (BlockIo->Media->BlockSize)
> So, here need to judge the status after ASSERT_EFI_ERROR.
> 
> The Bugzilla tracker for this:
> https://bugzilla.tianocore.org/show_bug.cgi?id=1631
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang <ming.huang@linaro.org>

Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

> ---
>  MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> index 4ce83ce22d61..0535cd7335b4 100644
> --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> @@ -1069,6 +1069,9 @@ BmExpandMediaDevicePath (
>    //
>    Status = gBS->HandleProtocol (Handle, &gEfiBlockIoProtocolGuid, (VOID **) &BlockIo);
>    ASSERT_EFI_ERROR (Status);
> +  if (EFI_ERROR (Status)) {
> +    return NULL;
> +  }
>    Buffer = AllocatePool (BlockIo->Media->BlockSize);
>    if (Buffer != NULL) {
>      BlockIo->ReadBlocks (
> -- 
> 2.9.5
> 


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

* Re: [Patch MdeModulePkg/Library v1 1/1] MdeModulePkg/UefiBootManangerLib: Fix exception issue
  2019-03-19 13:46   ` Leif Lindholm
@ 2019-03-21  1:12     ` Wu, Hao A
  0 siblings, 0 replies; 4+ messages in thread
From: Wu, Hao A @ 2019-03-21  1:12 UTC (permalink / raw)
  To: Leif Lindholm, Ming Huang
  Cc: linaro-uefi@lists.linaro.org, edk2-devel@lists.01.org,
	Kinney, Michael D, Gao, Liming, ard.biesheuvel@linaro.org,
	wanghuiqiang@huawei.com, huangming23@huawei.com,
	zhangjinsong2@huawei.com, mengfanrong@huawei.com,
	huangdaode@hisilicon.com

Thanks Ming and Leif.

Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Patch was committed at 6c27a4d337d0034cecf9f2c05d1f20c342d41e01.

Best Regards,
Hao Wu


> -----Original Message-----
> From: Leif Lindholm [mailto:leif.lindholm@linaro.org]
> Sent: Tuesday, March 19, 2019 9:47 PM
> To: Ming Huang
> Cc: linaro-uefi@lists.linaro.org; edk2-devel@lists.01.org; Wu, Hao A; Kinney,
> Michael D; Gao, Liming; ard.biesheuvel@linaro.org;
> wanghuiqiang@huawei.com; huangming23@huawei.com;
> zhangjinsong2@huawei.com; mengfanrong@huawei.com;
> huangdaode@hisilicon.com
> Subject: Re: [Patch MdeModulePkg/Library v1 1/1]
> MdeModulePkg/UefiBootManangerLib: Fix exception issue
> 
> Thanks, Ming.
> 
> On Tue, Mar 19, 2019 at 08:59:13PM +0800, Ming Huang wrote:
> > The system environment: virtual-CDROM(USB interface) via BMC, insert a
> > iso file to CDROM, like ubuntu-18.04.1-server-arm64.iso, change CDROM
> > to first boot option.
> > With release version bios, disconnecting CDROM when boot to
> > "1 seconds left, Press Esc or F2 to enter Setup"
> > then system will get a exception.
> >
> > The root cause is the EFI_BLOCK_IO_PROTOCOL for UsbMass will be
> uninstalled
> > in this situation after print some transfer error. The status will be
> > invalid parameter. This line will get a exception for BlockIo not point
> > to right address:
> > AllocatePool (BlockIo->Media->BlockSize)
> > So, here need to judge the status after ASSERT_EFI_ERROR.
> >
> > The Bugzilla tracker for this:
> > https://bugzilla.tianocore.org/show_bug.cgi?id=1631
> >
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Ming Huang <ming.huang@linaro.org>
> 
> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
> 
> > ---
> >  MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> > index 4ce83ce22d61..0535cd7335b4 100644
> > --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> > +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> > @@ -1069,6 +1069,9 @@ BmExpandMediaDevicePath (
> >    //
> >    Status = gBS->HandleProtocol (Handle, &gEfiBlockIoProtocolGuid, (VOID
> **) &BlockIo);
> >    ASSERT_EFI_ERROR (Status);
> > +  if (EFI_ERROR (Status)) {
> > +    return NULL;
> > +  }
> >    Buffer = AllocatePool (BlockIo->Media->BlockSize);
> >    if (Buffer != NULL) {
> >      BlockIo->ReadBlocks (
> > --
> > 2.9.5
> >


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

end of thread, other threads:[~2019-03-21  1:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-19 12:59 [Patch MdeModulePkg/Library v1 0/1] Fix exception issue while UsbMass block io uninstalled Ming Huang
2019-03-19 12:59 ` [Patch MdeModulePkg/Library v1 1/1] MdeModulePkg/UefiBootManangerLib: Fix exception issue Ming Huang
2019-03-19 13:46   ` Leif Lindholm
2019-03-21  1:12     ` Wu, Hao A

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