public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] UefiCpuPkg/Microcode.c: Add verification before calculate CheckSum32
@ 2019-03-05  0:21 Chen A Chen
  2019-03-06  2:15 ` Ni, Ray
  0 siblings, 1 reply; 5+ messages in thread
From: Chen A Chen @ 2019-03-05  0:21 UTC (permalink / raw)
  To: edk2-devel; +Cc: Chen A Chen, Ray Ni, Eric Dong

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1020

Should make sure the TotalSize of Microcode is aligned with 4 bytes
before calling CalculateSum32 function.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chen A Chen <chen.a.chen@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
---
 UefiCpuPkg/Library/MpInitLib/Microcode.c | 31 ++++++++++++++++++++-----------
 1 file changed, 20 insertions(+), 11 deletions(-)

diff --git a/UefiCpuPkg/Library/MpInitLib/Microcode.c b/UefiCpuPkg/Library/MpInitLib/Microcode.c
index 5f9ae22794..643a6f94f4 100644
--- a/UefiCpuPkg/Library/MpInitLib/Microcode.c
+++ b/UefiCpuPkg/Library/MpInitLib/Microcode.c
@@ -166,20 +166,29 @@ MicrocodeDetect (
     //
     CorrectMicrocode = FALSE;
 
-    //
-    // Save an in-complete CheckSum32 from CheckSum Part1 for common parts.
-    //
     if (MicrocodeEntryPoint->DataSize == 0) {
-      InCompleteCheckSum32 = CalculateSum32 (
-                               (UINT32 *) MicrocodeEntryPoint,
-                               sizeof (CPU_MICROCODE_HEADER) + 2000
-                               );
+      TotalSize = sizeof (CPU_MICROCODE_HEADER) + 2000;
     } else {
-      InCompleteCheckSum32 = CalculateSum32 (
-                               (UINT32 *) MicrocodeEntryPoint,
-                               sizeof (CPU_MICROCODE_HEADER) + MicrocodeEntryPoint->DataSize
-                               );
+      TotalSize = sizeof (CPU_MICROCODE_HEADER) + MicrocodeEntryPoint->DataSize;
     }
+
+    ///
+    /// Check overflow and whether TotalSize is aligned with 4 bytes.
+    ///
+    if ( ((UINTN)MicrocodeEntryPoint + TotalSize) > MicrocodeEnd ||
+         (TotalSize & 0x3) != 0
+       ) {
+      MicrocodeEntryPoint = (CPU_MICROCODE_HEADER *) (((UINTN) MicrocodeEntryPoint) + SIZE_1KB);
+      continue;
+    }
+
+    //
+    // Save an in-complete CheckSum32 from CheckSum Part1 for common parts.
+    //
+    InCompleteCheckSum32 = CalculateSum32 (
+                             (UINT32 *) MicrocodeEntryPoint,
+                             TotalSize
+                             );
     InCompleteCheckSum32 -= MicrocodeEntryPoint->ProcessorSignature.Uint32;
     InCompleteCheckSum32 -= MicrocodeEntryPoint->ProcessorFlags;
     InCompleteCheckSum32 -= MicrocodeEntryPoint->Checksum;
-- 
2.16.2.windows.1



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

* Re: [PATCH] UefiCpuPkg/Microcode.c: Add verification before calculate CheckSum32
  2019-03-05  0:21 [PATCH] UefiCpuPkg/Microcode.c: Add verification before calculate CheckSum32 Chen A Chen
@ 2019-03-06  2:15 ` Ni, Ray
  2019-03-06  5:35   ` Ni, Ray
  0 siblings, 1 reply; 5+ messages in thread
From: Ni, Ray @ 2019-03-06  2:15 UTC (permalink / raw)
  To: Chen, Chen A, edk2-devel@lists.01.org; +Cc: Dong, Eric

Reviewed-by: Ray Ni <ray.ni@intel.com>

> -----Original Message-----
> From: edk2-devel <edk2-devel-bounces@lists.01.org> On Behalf Of Chen A
> Chen
> Sent: Tuesday, March 5, 2019 8:21 AM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric <eric.dong@intel.com>
> Subject: [edk2] [PATCH] UefiCpuPkg/Microcode.c: Add verification before
> calculate CheckSum32
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1020
> 
> Should make sure the TotalSize of Microcode is aligned with 4 bytes
> before calling CalculateSum32 function.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Chen A Chen <chen.a.chen@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> ---
>  UefiCpuPkg/Library/MpInitLib/Microcode.c | 31 ++++++++++++++++++++--
> ---------
>  1 file changed, 20 insertions(+), 11 deletions(-)
> 
> diff --git a/UefiCpuPkg/Library/MpInitLib/Microcode.c
> b/UefiCpuPkg/Library/MpInitLib/Microcode.c
> index 5f9ae22794..643a6f94f4 100644
> --- a/UefiCpuPkg/Library/MpInitLib/Microcode.c
> +++ b/UefiCpuPkg/Library/MpInitLib/Microcode.c
> @@ -166,20 +166,29 @@ MicrocodeDetect (
>      //
>      CorrectMicrocode = FALSE;
> 
> -    //
> -    // Save an in-complete CheckSum32 from CheckSum Part1 for common
> parts.
> -    //
>      if (MicrocodeEntryPoint->DataSize == 0) {
> -      InCompleteCheckSum32 = CalculateSum32 (
> -                               (UINT32 *) MicrocodeEntryPoint,
> -                               sizeof (CPU_MICROCODE_HEADER) + 2000
> -                               );
> +      TotalSize = sizeof (CPU_MICROCODE_HEADER) + 2000;
>      } else {
> -      InCompleteCheckSum32 = CalculateSum32 (
> -                               (UINT32 *) MicrocodeEntryPoint,
> -                               sizeof (CPU_MICROCODE_HEADER) + MicrocodeEntryPoint-
> >DataSize
> -                               );
> +      TotalSize = sizeof (CPU_MICROCODE_HEADER) + MicrocodeEntryPoint-
> >DataSize;
>      }
> +
> +    ///
> +    /// Check overflow and whether TotalSize is aligned with 4 bytes.
> +    ///
> +    if ( ((UINTN)MicrocodeEntryPoint + TotalSize) > MicrocodeEnd ||
> +         (TotalSize & 0x3) != 0
> +       ) {
> +      MicrocodeEntryPoint = (CPU_MICROCODE_HEADER *) (((UINTN)
> MicrocodeEntryPoint) + SIZE_1KB);
> +      continue;
> +    }
> +
> +    //
> +    // Save an in-complete CheckSum32 from CheckSum Part1 for common
> parts.
> +    //
> +    InCompleteCheckSum32 = CalculateSum32 (
> +                             (UINT32 *) MicrocodeEntryPoint,
> +                             TotalSize
> +                             );
>      InCompleteCheckSum32 -= MicrocodeEntryPoint-
> >ProcessorSignature.Uint32;
>      InCompleteCheckSum32 -= MicrocodeEntryPoint->ProcessorFlags;
>      InCompleteCheckSum32 -= MicrocodeEntryPoint->Checksum;
> --
> 2.16.2.windows.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


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

* Re: [PATCH] UefiCpuPkg/Microcode.c: Add verification before calculate CheckSum32
  2019-03-06  2:15 ` Ni, Ray
@ 2019-03-06  5:35   ` Ni, Ray
  2019-03-06  5:38     ` Gao, Liming
  0 siblings, 1 reply; 5+ messages in thread
From: Ni, Ray @ 2019-03-06  5:35 UTC (permalink / raw)
  To: edk2-devel@lists.01.org, Gao, Liming; +Cc: Dong, Eric, Ni, Ray, Chen, Chen A

Liming,
Do I need any approval from you side before pushing the commit?

Thanks,
Ray

> -----Original Message-----
> From: edk2-devel <edk2-devel-bounces@lists.01.org> On Behalf Of Ni, Ray
> Sent: Wednesday, March 6, 2019 10:15 AM
> To: Chen, Chen A <chen.a.chen@intel.com>; edk2-devel@lists.01.org
> Cc: Dong, Eric <eric.dong@intel.com>
> Subject: Re: [edk2] [PATCH] UefiCpuPkg/Microcode.c: Add verification
> before calculate CheckSum32
> 
> Reviewed-by: Ray Ni <ray.ni@intel.com>
> 
> > -----Original Message-----
> > From: edk2-devel <edk2-devel-bounces@lists.01.org> On Behalf Of Chen A
> > Chen
> > Sent: Tuesday, March 5, 2019 8:21 AM
> > To: edk2-devel@lists.01.org
> > Cc: Dong, Eric <eric.dong@intel.com>
> > Subject: [edk2] [PATCH] UefiCpuPkg/Microcode.c: Add verification
> > before calculate CheckSum32
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1020
> >
> > Should make sure the TotalSize of Microcode is aligned with 4 bytes
> > before calling CalculateSum32 function.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Chen A Chen <chen.a.chen@intel.com>
> > Cc: Ray Ni <ray.ni@intel.com>
> > Cc: Eric Dong <eric.dong@intel.com>
> > ---
> >  UefiCpuPkg/Library/MpInitLib/Microcode.c | 31
> ++++++++++++++++++++--
> > ---------
> >  1 file changed, 20 insertions(+), 11 deletions(-)
> >
> > diff --git a/UefiCpuPkg/Library/MpInitLib/Microcode.c
> > b/UefiCpuPkg/Library/MpInitLib/Microcode.c
> > index 5f9ae22794..643a6f94f4 100644
> > --- a/UefiCpuPkg/Library/MpInitLib/Microcode.c
> > +++ b/UefiCpuPkg/Library/MpInitLib/Microcode.c
> > @@ -166,20 +166,29 @@ MicrocodeDetect (
> >      //
> >      CorrectMicrocode = FALSE;
> >
> > -    //
> > -    // Save an in-complete CheckSum32 from CheckSum Part1 for common
> > parts.
> > -    //
> >      if (MicrocodeEntryPoint->DataSize == 0) {
> > -      InCompleteCheckSum32 = CalculateSum32 (
> > -                               (UINT32 *) MicrocodeEntryPoint,
> > -                               sizeof (CPU_MICROCODE_HEADER) + 2000
> > -                               );
> > +      TotalSize = sizeof (CPU_MICROCODE_HEADER) + 2000;
> >      } else {
> > -      InCompleteCheckSum32 = CalculateSum32 (
> > -                               (UINT32 *) MicrocodeEntryPoint,
> > -                               sizeof (CPU_MICROCODE_HEADER) +
> MicrocodeEntryPoint-
> > >DataSize
> > -                               );
> > +      TotalSize = sizeof (CPU_MICROCODE_HEADER) +
> > + MicrocodeEntryPoint-
> > >DataSize;
> >      }
> > +
> > +    ///
> > +    /// Check overflow and whether TotalSize is aligned with 4 bytes.
> > +    ///
> > +    if ( ((UINTN)MicrocodeEntryPoint + TotalSize) > MicrocodeEnd ||
> > +         (TotalSize & 0x3) != 0
> > +       ) {
> > +      MicrocodeEntryPoint = (CPU_MICROCODE_HEADER *) (((UINTN)
> > MicrocodeEntryPoint) + SIZE_1KB);
> > +      continue;
> > +    }
> > +
> > +    //
> > +    // Save an in-complete CheckSum32 from CheckSum Part1 for common
> > parts.
> > +    //
> > +    InCompleteCheckSum32 = CalculateSum32 (
> > +                             (UINT32 *) MicrocodeEntryPoint,
> > +                             TotalSize
> > +                             );
> >      InCompleteCheckSum32 -= MicrocodeEntryPoint-
> > >ProcessorSignature.Uint32;
> >      InCompleteCheckSum32 -= MicrocodeEntryPoint->ProcessorFlags;
> >      InCompleteCheckSum32 -= MicrocodeEntryPoint->Checksum;
> > --
> > 2.16.2.windows.1
> >
> > _______________________________________________
> > 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


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

* Re: [PATCH] UefiCpuPkg/Microcode.c: Add verification before calculate CheckSum32
  2019-03-06  5:35   ` Ni, Ray
@ 2019-03-06  5:38     ` Gao, Liming
  2019-03-06  5:46       ` Ni, Ray
  0 siblings, 1 reply; 5+ messages in thread
From: Gao, Liming @ 2019-03-06  5:38 UTC (permalink / raw)
  To: Ni, Ray, edk2-devel@lists.01.org; +Cc: Dong, Eric, Chen, Chen A

This is a bug. I agree to add it into Q1 stable tag. 

Thanks
Liming
> -----Original Message-----
> From: Ni, Ray
> Sent: Tuesday, March 5, 2019 9:35 PM
> To: edk2-devel@lists.01.org; Gao, Liming <liming.gao@intel.com>
> Cc: Dong, Eric <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Chen, Chen A <chen.a.chen@intel.com>
> Subject: RE: [edk2] [PATCH] UefiCpuPkg/Microcode.c: Add verification before calculate CheckSum32
> 
> Liming,
> Do I need any approval from you side before pushing the commit?
> 
> Thanks,
> Ray
> 
> > -----Original Message-----
> > From: edk2-devel <edk2-devel-bounces@lists.01.org> On Behalf Of Ni, Ray
> > Sent: Wednesday, March 6, 2019 10:15 AM
> > To: Chen, Chen A <chen.a.chen@intel.com>; edk2-devel@lists.01.org
> > Cc: Dong, Eric <eric.dong@intel.com>
> > Subject: Re: [edk2] [PATCH] UefiCpuPkg/Microcode.c: Add verification
> > before calculate CheckSum32
> >
> > Reviewed-by: Ray Ni <ray.ni@intel.com>
> >
> > > -----Original Message-----
> > > From: edk2-devel <edk2-devel-bounces@lists.01.org> On Behalf Of Chen A
> > > Chen
> > > Sent: Tuesday, March 5, 2019 8:21 AM
> > > To: edk2-devel@lists.01.org
> > > Cc: Dong, Eric <eric.dong@intel.com>
> > > Subject: [edk2] [PATCH] UefiCpuPkg/Microcode.c: Add verification
> > > before calculate CheckSum32
> > >
> > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1020
> > >
> > > Should make sure the TotalSize of Microcode is aligned with 4 bytes
> > > before calling CalculateSum32 function.
> > >
> > > Contributed-under: TianoCore Contribution Agreement 1.1
> > > Signed-off-by: Chen A Chen <chen.a.chen@intel.com>
> > > Cc: Ray Ni <ray.ni@intel.com>
> > > Cc: Eric Dong <eric.dong@intel.com>
> > > ---
> > >  UefiCpuPkg/Library/MpInitLib/Microcode.c | 31
> > ++++++++++++++++++++--
> > > ---------
> > >  1 file changed, 20 insertions(+), 11 deletions(-)
> > >
> > > diff --git a/UefiCpuPkg/Library/MpInitLib/Microcode.c
> > > b/UefiCpuPkg/Library/MpInitLib/Microcode.c
> > > index 5f9ae22794..643a6f94f4 100644
> > > --- a/UefiCpuPkg/Library/MpInitLib/Microcode.c
> > > +++ b/UefiCpuPkg/Library/MpInitLib/Microcode.c
> > > @@ -166,20 +166,29 @@ MicrocodeDetect (
> > >      //
> > >      CorrectMicrocode = FALSE;
> > >
> > > -    //
> > > -    // Save an in-complete CheckSum32 from CheckSum Part1 for common
> > > parts.
> > > -    //
> > >      if (MicrocodeEntryPoint->DataSize == 0) {
> > > -      InCompleteCheckSum32 = CalculateSum32 (
> > > -                               (UINT32 *) MicrocodeEntryPoint,
> > > -                               sizeof (CPU_MICROCODE_HEADER) + 2000
> > > -                               );
> > > +      TotalSize = sizeof (CPU_MICROCODE_HEADER) + 2000;
> > >      } else {
> > > -      InCompleteCheckSum32 = CalculateSum32 (
> > > -                               (UINT32 *) MicrocodeEntryPoint,
> > > -                               sizeof (CPU_MICROCODE_HEADER) +
> > MicrocodeEntryPoint-
> > > >DataSize
> > > -                               );
> > > +      TotalSize = sizeof (CPU_MICROCODE_HEADER) +
> > > + MicrocodeEntryPoint-
> > > >DataSize;
> > >      }
> > > +
> > > +    ///
> > > +    /// Check overflow and whether TotalSize is aligned with 4 bytes.
> > > +    ///
> > > +    if ( ((UINTN)MicrocodeEntryPoint + TotalSize) > MicrocodeEnd ||
> > > +         (TotalSize & 0x3) != 0
> > > +       ) {
> > > +      MicrocodeEntryPoint = (CPU_MICROCODE_HEADER *) (((UINTN)
> > > MicrocodeEntryPoint) + SIZE_1KB);
> > > +      continue;
> > > +    }
> > > +
> > > +    //
> > > +    // Save an in-complete CheckSum32 from CheckSum Part1 for common
> > > parts.
> > > +    //
> > > +    InCompleteCheckSum32 = CalculateSum32 (
> > > +                             (UINT32 *) MicrocodeEntryPoint,
> > > +                             TotalSize
> > > +                             );
> > >      InCompleteCheckSum32 -= MicrocodeEntryPoint-
> > > >ProcessorSignature.Uint32;
> > >      InCompleteCheckSum32 -= MicrocodeEntryPoint->ProcessorFlags;
> > >      InCompleteCheckSum32 -= MicrocodeEntryPoint->Checksum;
> > > --
> > > 2.16.2.windows.1
> > >
> > > _______________________________________________
> > > 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


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

* Re: [PATCH] UefiCpuPkg/Microcode.c: Add verification before calculate CheckSum32
  2019-03-06  5:38     ` Gao, Liming
@ 2019-03-06  5:46       ` Ni, Ray
  0 siblings, 0 replies; 5+ messages in thread
From: Ni, Ray @ 2019-03-06  5:46 UTC (permalink / raw)
  To: Gao, Liming, edk2-devel@lists.01.org; +Cc: Dong, Eric, Chen, Chen A

Pushed @ 219e560c20034843ac9917146c60db99bd01b6f4.

> -----Original Message-----
> From: Gao, Liming <liming.gao@intel.com>
> Sent: Wednesday, March 6, 2019 1:38 PM
> To: Ni, Ray <ray.ni@intel.com>; edk2-devel@lists.01.org
> Cc: Dong, Eric <eric.dong@intel.com>; Chen, Chen A
> <chen.a.chen@intel.com>
> Subject: RE: [edk2] [PATCH] UefiCpuPkg/Microcode.c: Add verification
> before calculate CheckSum32
> 
> This is a bug. I agree to add it into Q1 stable tag.
> 
> Thanks
> Liming
> > -----Original Message-----
> > From: Ni, Ray
> > Sent: Tuesday, March 5, 2019 9:35 PM
> > To: edk2-devel@lists.01.org; Gao, Liming <liming.gao@intel.com>
> > Cc: Dong, Eric <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>;
> > Chen, Chen A <chen.a.chen@intel.com>
> > Subject: RE: [edk2] [PATCH] UefiCpuPkg/Microcode.c: Add verification
> > before calculate CheckSum32
> >
> > Liming,
> > Do I need any approval from you side before pushing the commit?
> >
> > Thanks,
> > Ray
> >
> > > -----Original Message-----
> > > From: edk2-devel <edk2-devel-bounces@lists.01.org> On Behalf Of Ni,
> > > Ray
> > > Sent: Wednesday, March 6, 2019 10:15 AM
> > > To: Chen, Chen A <chen.a.chen@intel.com>; edk2-devel@lists.01.org
> > > Cc: Dong, Eric <eric.dong@intel.com>
> > > Subject: Re: [edk2] [PATCH] UefiCpuPkg/Microcode.c: Add verification
> > > before calculate CheckSum32
> > >
> > > Reviewed-by: Ray Ni <ray.ni@intel.com>
> > >
> > > > -----Original Message-----
> > > > From: edk2-devel <edk2-devel-bounces@lists.01.org> On Behalf Of
> > > > Chen A Chen
> > > > Sent: Tuesday, March 5, 2019 8:21 AM
> > > > To: edk2-devel@lists.01.org
> > > > Cc: Dong, Eric <eric.dong@intel.com>
> > > > Subject: [edk2] [PATCH] UefiCpuPkg/Microcode.c: Add verification
> > > > before calculate CheckSum32
> > > >
> > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1020
> > > >
> > > > Should make sure the TotalSize of Microcode is aligned with 4
> > > > bytes before calling CalculateSum32 function.
> > > >
> > > > Contributed-under: TianoCore Contribution Agreement 1.1
> > > > Signed-off-by: Chen A Chen <chen.a.chen@intel.com>
> > > > Cc: Ray Ni <ray.ni@intel.com>
> > > > Cc: Eric Dong <eric.dong@intel.com>
> > > > ---
> > > >  UefiCpuPkg/Library/MpInitLib/Microcode.c | 31
> > > ++++++++++++++++++++--
> > > > ---------
> > > >  1 file changed, 20 insertions(+), 11 deletions(-)
> > > >
> > > > diff --git a/UefiCpuPkg/Library/MpInitLib/Microcode.c
> > > > b/UefiCpuPkg/Library/MpInitLib/Microcode.c
> > > > index 5f9ae22794..643a6f94f4 100644
> > > > --- a/UefiCpuPkg/Library/MpInitLib/Microcode.c
> > > > +++ b/UefiCpuPkg/Library/MpInitLib/Microcode.c
> > > > @@ -166,20 +166,29 @@ MicrocodeDetect (
> > > >      //
> > > >      CorrectMicrocode = FALSE;
> > > >
> > > > -    //
> > > > -    // Save an in-complete CheckSum32 from CheckSum Part1 for
> common
> > > > parts.
> > > > -    //
> > > >      if (MicrocodeEntryPoint->DataSize == 0) {
> > > > -      InCompleteCheckSum32 = CalculateSum32 (
> > > > -                               (UINT32 *) MicrocodeEntryPoint,
> > > > -                               sizeof (CPU_MICROCODE_HEADER) + 2000
> > > > -                               );
> > > > +      TotalSize = sizeof (CPU_MICROCODE_HEADER) + 2000;
> > > >      } else {
> > > > -      InCompleteCheckSum32 = CalculateSum32 (
> > > > -                               (UINT32 *) MicrocodeEntryPoint,
> > > > -                               sizeof (CPU_MICROCODE_HEADER) +
> > > MicrocodeEntryPoint-
> > > > >DataSize
> > > > -                               );
> > > > +      TotalSize = sizeof (CPU_MICROCODE_HEADER) +
> > > > + MicrocodeEntryPoint-
> > > > >DataSize;
> > > >      }
> > > > +
> > > > +    ///
> > > > +    /// Check overflow and whether TotalSize is aligned with 4 bytes.
> > > > +    ///
> > > > +    if ( ((UINTN)MicrocodeEntryPoint + TotalSize) > MicrocodeEnd ||
> > > > +         (TotalSize & 0x3) != 0
> > > > +       ) {
> > > > +      MicrocodeEntryPoint = (CPU_MICROCODE_HEADER *) (((UINTN)
> > > > MicrocodeEntryPoint) + SIZE_1KB);
> > > > +      continue;
> > > > +    }
> > > > +
> > > > +    //
> > > > +    // Save an in-complete CheckSum32 from CheckSum Part1 for
> > > > + common
> > > > parts.
> > > > +    //
> > > > +    InCompleteCheckSum32 = CalculateSum32 (
> > > > +                             (UINT32 *) MicrocodeEntryPoint,
> > > > +                             TotalSize
> > > > +                             );
> > > >      InCompleteCheckSum32 -= MicrocodeEntryPoint-
> > > > >ProcessorSignature.Uint32;
> > > >      InCompleteCheckSum32 -= MicrocodeEntryPoint->ProcessorFlags;
> > > >      InCompleteCheckSum32 -= MicrocodeEntryPoint->Checksum;
> > > > --
> > > > 2.16.2.windows.1
> > > >
> > > > _______________________________________________
> > > > 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


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

end of thread, other threads:[~2019-03-06  5:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-05  0:21 [PATCH] UefiCpuPkg/Microcode.c: Add verification before calculate CheckSum32 Chen A Chen
2019-03-06  2:15 ` Ni, Ray
2019-03-06  5:35   ` Ni, Ray
2019-03-06  5:38     ` Gao, Liming
2019-03-06  5:46       ` Ni, Ray

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