]> git.proxmox.com Git - mirror_edk2.git/commitdiff
IntelSiliconPkg MicrocodeUpdateDxe: Fix (ExtendedTableLength & 0x3)!=0
authorStar Zeng <star.zeng@intel.com>
Thu, 21 Dec 2017 02:32:39 +0000 (10:32 +0800)
committerStar Zeng <star.zeng@intel.com>
Thu, 21 Dec 2017 10:34:55 +0000 (18:34 +0800)
The first 48 bytes contain the microcode update header.
DataSize must be a multiple of DWORDs.
TotalSize is always a multiple of 1024.
Both size of CPU_MICROCODE_EXTENDED_TABLE_HEADER and
CPU_MICROCODE_EXTENDED_TABLE are multiple of DWORDs.

So (ExtendedTableLength & 0x3)!=0 should be
(ExtendedTableLength & 0x3)==0.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c

index 4e8f1d5fd8a881d71928d75c78c5b547738f0b99..b99221c9696d0ab57385ddedea8a30b252ed87f0 100644 (file)
@@ -8,7 +8,7 @@
 \r
   MicrocodeWrite() and VerifyMicrocode() will receive untrusted input and do basic validation.\r
 \r
-  Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -494,7 +494,7 @@ VerifyMicrocode (
       //\r
       // Calculate Extended Checksum\r
       //\r
-      if ((ExtendedTableLength > sizeof(CPU_MICROCODE_EXTENDED_TABLE_HEADER)) && ((ExtendedTableLength & 0x3) != 0)) {\r
+      if ((ExtendedTableLength > sizeof(CPU_MICROCODE_EXTENDED_TABLE_HEADER)) && ((ExtendedTableLength & 0x3) == 0)) {\r
         CheckSum32 = CalculateSum32((UINT32 *)ExtendedTableHeader, ExtendedTableLength);\r
         if (CheckSum32 == 0) {\r
           //\r