public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdeModulePkg AtaAtapiPassThru: Skip the potential NULL pointer access
@ 2021-11-16  2:53 gaoliming
  2021-11-16  3:48 ` [edk2-devel] " Wu, Hao A
  2021-11-23 13:10 ` Rebecca Cran
  0 siblings, 2 replies; 5+ messages in thread
From: gaoliming @ 2021-11-16  2:53 UTC (permalink / raw)
  To: devel; +Cc: Hao A Wu, Ray Ni

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3732
Recent change c974257821208fc6191779d1ddea918499f165b8 exposes this potential issue.

Signed-off-by: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
---
 MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
index 7626bac38d..bda900a161 100644
--- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
+++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
@@ -885,6 +885,13 @@ AhciPrintStatusBlock (
   IN UINT32                DebugLevel
   )
 {
+  //
+  // Skip NULL pointer
+  //
+  if (AtaStatusBlock == NULL) {
+    return;
+  }
+
   //
   // Only print status and error since we have all of the rest printed as
   // a part of command block print.
-- 
2.27.0.windows.1



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

* Re: [edk2-devel] [PATCH] MdeModulePkg AtaAtapiPassThru: Skip the potential NULL pointer access
  2021-11-16  2:53 [PATCH] MdeModulePkg AtaAtapiPassThru: Skip the potential NULL pointer access gaoliming
@ 2021-11-16  3:48 ` Wu, Hao A
  2021-11-23 13:10 ` Rebecca Cran
  1 sibling, 0 replies; 5+ messages in thread
From: Wu, Hao A @ 2021-11-16  3:48 UTC (permalink / raw)
  To: devel@edk2.groups.io, gaoliming@byosoft.com.cn; +Cc: Ni, Ray

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> gaoliming
> Sent: Tuesday, November 16, 2021 10:53 AM
> To: devel@edk2.groups.io
> Cc: Wu, Hao A <hao.a.wu@intel.com>; Ni, Ray <ray.ni@intel.com>
> Subject: [edk2-devel] [PATCH] MdeModulePkg AtaAtapiPassThru: Skip the
> potential NULL pointer access
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3732
> Recent change c974257821208fc6191779d1ddea918499f165b8 exposes this
> potential issue.


Reviewed-by: Hao A Wu <hao.a.wu@intel.com>

Best Regards,
Hao Wu


> 
> Signed-off-by: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> ---
>  MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
> b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
> index 7626bac38d..bda900a161 100644
> --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
> +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
> @@ -885,6 +885,13 @@ AhciPrintStatusBlock (
>    IN UINT32                DebugLevel
>    )
>  {
> +  //
> +  // Skip NULL pointer
> +  //
> +  if (AtaStatusBlock == NULL) {
> +    return;
> +  }
> +
>    //
>    // Only print status and error since we have all of the rest printed as
>    // a part of command block print.
> --
> 2.27.0.windows.1
> 
> 
> 
> 
> 
> 


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

* Re: [edk2-devel] [PATCH] MdeModulePkg AtaAtapiPassThru: Skip the potential NULL pointer access
  2021-11-16  2:53 [PATCH] MdeModulePkg AtaAtapiPassThru: Skip the potential NULL pointer access gaoliming
  2021-11-16  3:48 ` [edk2-devel] " Wu, Hao A
@ 2021-11-23 13:10 ` Rebecca Cran
  2021-11-23 13:19   ` edk2-stable202111 " Leif Lindholm
  1 sibling, 1 reply; 5+ messages in thread
From: Rebecca Cran @ 2021-11-23 13:10 UTC (permalink / raw)
  To: devel, gaoliming; +Cc: Hao A Wu, Ray Ni, Leif Lindholm

Acked-by: Rebecca Cran <rebecca@nuviainc.com>


I've confirmed that this patch fixes the exception I was seeing when 
running the DEBUG build of SbsaQemu.


-- 

Rebecca Cran


On 11/15/21 7:53 PM, gaoliming wrote:
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3732
> Recent change c974257821208fc6191779d1ddea918499f165b8 exposes this potential issue.
>
> Signed-off-by: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> ---
>   MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c | 7 +++++++
>   1 file changed, 7 insertions(+)
>
> diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
> index 7626bac38d..bda900a161 100644
> --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
> +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
> @@ -885,6 +885,13 @@ AhciPrintStatusBlock (
>     IN UINT32                DebugLevel
>     )
>   {
> +  //
> +  // Skip NULL pointer
> +  //
> +  if (AtaStatusBlock == NULL) {
> +    return;
> +  }
> +
>     //
>     // Only print status and error since we have all of the rest printed as
>     // a part of command block print.

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

* edk2-stable202111 Re: [edk2-devel] [PATCH] MdeModulePkg AtaAtapiPassThru: Skip the potential NULL pointer access
  2021-11-23 13:10 ` Rebecca Cran
@ 2021-11-23 13:19   ` Leif Lindholm
  2021-11-24  6:17     ` 回复: " gaoliming
  0 siblings, 1 reply; 5+ messages in thread
From: Leif Lindholm @ 2021-11-23 13:19 UTC (permalink / raw)
  To: Rebecca Cran, gaoliming
  Cc: devel, Hao A Wu, Ray Ni, Andrew Fish, Michael D Kinney

Since BZ3732 has been triggered by a standard build of a platform in
edk2-platforms, I would request that this fix is brought into the
upcoming stable tag.

SbsaQemu isn't a "real" platform, so I don't consider that in itself
sufficient reason, but I feel the risk of it affecting other
(including out-of-tree) platforms justifies it.

Best Regards,

Leif

On Tue, Nov 23, 2021 at 06:10:14 -0700, Rebecca Cran wrote:
> Acked-by: Rebecca Cran <rebecca@nuviainc.com>
> 
> 
> I've confirmed that this patch fixes the exception I was seeing when running
> the DEBUG build of SbsaQemu.
> 
> 
> -- 
> 
> Rebecca Cran
> 
> 
> On 11/15/21 7:53 PM, gaoliming wrote:
> > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3732
> > Recent change c974257821208fc6191779d1ddea918499f165b8 exposes this potential issue.
> > 
> > Signed-off-by: Liming Gao <gaoliming@byosoft.com.cn>
> > Cc: Hao A Wu <hao.a.wu@intel.com>
> > Cc: Ray Ni <ray.ni@intel.com>
> > ---
> >   MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c | 7 +++++++
> >   1 file changed, 7 insertions(+)
> > 
> > diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
> > index 7626bac38d..bda900a161 100644
> > --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
> > +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
> > @@ -885,6 +885,13 @@ AhciPrintStatusBlock (
> >     IN UINT32                DebugLevel
> >     )
> >   {
> > +  //
> > +  // Skip NULL pointer
> > +  //
> > +  if (AtaStatusBlock == NULL) {
> > +    return;
> > +  }
> > +
> >     //
> >     // Only print status and error since we have all of the rest printed as
> >     // a part of command block print.

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

* 回复: edk2-stable202111 Re: [edk2-devel] [PATCH] MdeModulePkg AtaAtapiPassThru: Skip the potential NULL pointer access
  2021-11-23 13:19   ` edk2-stable202111 " Leif Lindholm
@ 2021-11-24  6:17     ` gaoliming
  0 siblings, 0 replies; 5+ messages in thread
From: gaoliming @ 2021-11-24  6:17 UTC (permalink / raw)
  To: devel, leif, 'Rebecca Cran'
  Cc: 'Hao A Wu', 'Ray Ni', 'Andrew Fish',
	'Michael D Kinney'

Leif:
  Thanks for your suggestion. I am OK to merge this patch into stable
tag20211.

Thanks
Liming
> -----邮件原件-----
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Leif Lindholm
> 发送时间: 2021年11月23日 21:19
> 收件人: Rebecca Cran <rebecca@nuviainc.com>; gaoliming@byosoft.com.cn
> 抄送: devel@edk2.groups.io; Hao A Wu <hao.a.wu@intel.com>; Ray Ni
> <ray.ni@intel.com>; Andrew Fish <afish@apple.com>; Michael D Kinney
> <michael.d.kinney@intel.com>
> 主题: edk2-stable202111 Re: [edk2-devel] [PATCH] MdeModulePkg
> AtaAtapiPassThru: Skip the potential NULL pointer access
> 
> Since BZ3732 has been triggered by a standard build of a platform in
> edk2-platforms, I would request that this fix is brought into the
> upcoming stable tag.
> 
> SbsaQemu isn't a "real" platform, so I don't consider that in itself
> sufficient reason, but I feel the risk of it affecting other
> (including out-of-tree) platforms justifies it.
> 
> Best Regards,
> 
> Leif
> 
> On Tue, Nov 23, 2021 at 06:10:14 -0700, Rebecca Cran wrote:
> > Acked-by: Rebecca Cran <rebecca@nuviainc.com>
> >
> >
> > I've confirmed that this patch fixes the exception I was seeing when
running
> > the DEBUG build of SbsaQemu.
> >
> >
> > --
> >
> > Rebecca Cran
> >
> >
> > On 11/15/21 7:53 PM, gaoliming wrote:
> > > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3732
> > > Recent change c974257821208fc6191779d1ddea918499f165b8 exposes
> this potential issue.
> > >
> > > Signed-off-by: Liming Gao <gaoliming@byosoft.com.cn>
> > > Cc: Hao A Wu <hao.a.wu@intel.com>
> > > Cc: Ray Ni <ray.ni@intel.com>
> > > ---
> > >   MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c | 7 +++++++
> > >   1 file changed, 7 insertions(+)
> > >
> > > diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
> b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
> > > index 7626bac38d..bda900a161 100644
> > > --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
> > > +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
> > > @@ -885,6 +885,13 @@ AhciPrintStatusBlock (
> > >     IN UINT32                DebugLevel
> > >     )
> > >   {
> > > +  //
> > > +  // Skip NULL pointer
> > > +  //
> > > +  if (AtaStatusBlock == NULL) {
> > > +    return;
> > > +  }
> > > +
> > >     //
> > >     // Only print status and error since we have all of the rest
printed as
> > >     // a part of command block print.
> 
> 
> 
> 




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

end of thread, other threads:[~2021-11-24  6:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-16  2:53 [PATCH] MdeModulePkg AtaAtapiPassThru: Skip the potential NULL pointer access gaoliming
2021-11-16  3:48 ` [edk2-devel] " Wu, Hao A
2021-11-23 13:10 ` Rebecca Cran
2021-11-23 13:19   ` edk2-stable202111 " Leif Lindholm
2021-11-24  6:17     ` 回复: " gaoliming

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