public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] QuarkSocPkg/QNCSmmDispatcher: Fix use after free issue #2
@ 2017-07-21  6:11 Marvin Häuser
  2017-08-17  2:41 ` Kinney, Michael D
  0 siblings, 1 reply; 3+ messages in thread
From: Marvin Häuser @ 2017-07-21  6:11 UTC (permalink / raw)
  To: edk2-devel@lists.01.org
  Cc: michael.d.kinney@intel.com, kelly.steele@intel.com

As part of commit 5f82e02, ActiveRecordInDb was introduced as a copy
of RecordInDb as latter may be freed by the callback function. This
commit replaces an access of RecordInDb after the callback function
has been executed with an access to ActiveRecordInDb.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
---
 QuarkSocPkg/QuarkNorthCluster/Smm/DxeSmm/QncSmmDispatcher/QNCSmmCore.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/QuarkSocPkg/QuarkNorthCluster/Smm/DxeSmm/QncSmmDispatcher/QNCSmmCore.c b/QuarkSocPkg/QuarkNorthCluster/Smm/DxeSmm/QncSmmDispatcher/QNCSmmCore.c
index c2f75f86647a..29ad5f493466 100644
--- a/QuarkSocPkg/QuarkNorthCluster/Smm/DxeSmm/QncSmmDispatcher/QNCSmmCore.c
+++ b/QuarkSocPkg/QuarkNorthCluster/Smm/DxeSmm/QncSmmDispatcher/QNCSmmCore.c
@@ -758,7 +758,7 @@ QNCSmmCoreDispatcher (
             }
           }
 
-          if (RecordInDb->ClearSource == NULL) {
+          if (ActiveRecordInDb.ClearSource == NULL) {
             //
             // Clear the SMI associated w/ the source using the default function
             //
-- 
2.12.2.windows.2



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

* Re: [PATCH] QuarkSocPkg/QNCSmmDispatcher: Fix use after free issue #2
  2017-07-21  6:11 [PATCH] QuarkSocPkg/QNCSmmDispatcher: Fix use after free issue #2 Marvin Häuser
@ 2017-08-17  2:41 ` Kinney, Michael D
  2017-08-17  2:46   ` Kinney, Michael D
  0 siblings, 1 reply; 3+ messages in thread
From: Kinney, Michael D @ 2017-08-17  2:41 UTC (permalink / raw)
  To: Marvin Häuser, edk2-devel@lists.01.org, Kinney, Michael D

Marvin,

Thanks for the fix!

Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>

I will push shortly.

Mike

> -----Original Message-----
> From: Marvin Häuser [mailto:Marvin.Haeuser@outlook.com]
> Sent: Thursday, July 20, 2017 11:12 PM
> To: edk2-devel@lists.01.org
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Steele,
> Kelly <kelly.steele@intel.com>
> Subject: [PATCH] QuarkSocPkg/QNCSmmDispatcher: Fix use after
> free issue #2
> 
> As part of commit 5f82e02, ActiveRecordInDb was introduced as
> a copy
> of RecordInDb as latter may be freed by the callback function.
> This
> commit replaces an access of RecordInDb after the callback
> function
> has been executed with an access to ActiveRecordInDb.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
> ---
> 
> QuarkSocPkg/QuarkNorthCluster/Smm/DxeSmm/QncSmmDispatcher/QNCS
> mmCore.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git
> a/QuarkSocPkg/QuarkNorthCluster/Smm/DxeSmm/QncSmmDispatcher/QN
> CSmmCore.c
> b/QuarkSocPkg/QuarkNorthCluster/Smm/DxeSmm/QncSmmDispatcher/QN
> CSmmCore.c
> index c2f75f86647a..29ad5f493466 100644
> ---
> a/QuarkSocPkg/QuarkNorthCluster/Smm/DxeSmm/QncSmmDispatcher/QN
> CSmmCore.c
> +++
> b/QuarkSocPkg/QuarkNorthCluster/Smm/DxeSmm/QncSmmDispatcher/QN
> CSmmCore.c
> @@ -758,7 +758,7 @@ QNCSmmCoreDispatcher (
>              }
>            }
> 
> -          if (RecordInDb->ClearSource == NULL) {
> +          if (ActiveRecordInDb.ClearSource == NULL) {
>              //
>              // Clear the SMI associated w/ the source using
> the default function
>              //
> --
> 2.12.2.windows.2



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

* Re: [PATCH] QuarkSocPkg/QNCSmmDispatcher: Fix use after free issue #2
  2017-08-17  2:41 ` Kinney, Michael D
@ 2017-08-17  2:46   ` Kinney, Michael D
  0 siblings, 0 replies; 3+ messages in thread
From: Kinney, Michael D @ 2017-08-17  2:46 UTC (permalink / raw)
  To: Marvin Häuser, edk2-devel@lists.01.org, Kinney, Michael D

Pushed as 4e33ff75d9

> -----Original Message-----
> From: Kinney, Michael D
> Sent: Wednesday, August 16, 2017 7:41 PM
> To: Marvin Häuser <Marvin.Haeuser@outlook.com>; edk2-
> devel@lists.01.org; Kinney, Michael D
> <michael.d.kinney@intel.com>
> Cc: Steele, Kelly <kelly.steele@intel.com>
> Subject: RE: [PATCH] QuarkSocPkg/QNCSmmDispatcher: Fix use
> after free issue #2
> 
> Marvin,
> 
> Thanks for the fix!
> 
> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
> 
> I will push shortly.
> 
> Mike
> 
> > -----Original Message-----
> > From: Marvin Häuser [mailto:Marvin.Haeuser@outlook.com]
> > Sent: Thursday, July 20, 2017 11:12 PM
> > To: edk2-devel@lists.01.org
> > Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Steele,
> > Kelly <kelly.steele@intel.com>
> > Subject: [PATCH] QuarkSocPkg/QNCSmmDispatcher: Fix use after
> > free issue #2
> >
> > As part of commit 5f82e02, ActiveRecordInDb was introduced
> as
> > a copy
> > of RecordInDb as latter may be freed by the callback
> function.
> > This
> > commit replaces an access of RecordInDb after the callback
> > function
> > has been executed with an access to ActiveRecordInDb.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
> > ---
> >
> >
> QuarkSocPkg/QuarkNorthCluster/Smm/DxeSmm/QncSmmDispatcher/QNCS
> > mmCore.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git
> >
> a/QuarkSocPkg/QuarkNorthCluster/Smm/DxeSmm/QncSmmDispatcher/QN
> > CSmmCore.c
> >
> b/QuarkSocPkg/QuarkNorthCluster/Smm/DxeSmm/QncSmmDispatcher/QN
> > CSmmCore.c
> > index c2f75f86647a..29ad5f493466 100644
> > ---
> >
> a/QuarkSocPkg/QuarkNorthCluster/Smm/DxeSmm/QncSmmDispatcher/QN
> > CSmmCore.c
> > +++
> >
> b/QuarkSocPkg/QuarkNorthCluster/Smm/DxeSmm/QncSmmDispatcher/QN
> > CSmmCore.c
> > @@ -758,7 +758,7 @@ QNCSmmCoreDispatcher (
> >              }
> >            }
> >
> > -          if (RecordInDb->ClearSource == NULL) {
> > +          if (ActiveRecordInDb.ClearSource == NULL) {
> >              //
> >              // Clear the SMI associated w/ the source using
> > the default function
> >              //
> > --
> > 2.12.2.windows.2



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

end of thread, other threads:[~2017-08-17  2:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-21  6:11 [PATCH] QuarkSocPkg/QNCSmmDispatcher: Fix use after free issue #2 Marvin Häuser
2017-08-17  2:41 ` Kinney, Michael D
2017-08-17  2:46   ` Kinney, Michael D

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