summaryrefslogtreecommitdiffstats
path: root/IntelSiliconPkg
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2017-12-21 10:32:39 +0800
committerStar Zeng <star.zeng@intel.com>2017-12-21 18:34:55 +0800
commit3bd91ae2365896f049bf44a4bf048eb52d7e26db (patch)
treec713d491d096b3f63aa89c69403b7078939a8a77 /IntelSiliconPkg
parent889c7ca1b5e8eb3e3e2c04a5be76eb49e16834e5 (diff)
downloadedk2-3bd91ae2365896f049bf44a4bf048eb52d7e26db.tar.gz
edk2-3bd91ae2365896f049bf44a4bf048eb52d7e26db.tar.bz2
edk2-3bd91ae2365896f049bf44a4bf048eb52d7e26db.zip
IntelSiliconPkg MicrocodeUpdateDxe: Fix (ExtendedTableLength & 0x3)!=0
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>
Diffstat (limited to 'IntelSiliconPkg')
-rw-r--r--IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c b/IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c
index 4e8f1d5fd8..b99221c969 100644
--- a/IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c
+++ b/IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdate.c
@@ -8,7 +8,7 @@
MicrocodeWrite() and VerifyMicrocode() will receive untrusted input and do basic validation.
- Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -494,7 +494,7 @@ VerifyMicrocode (
//
// Calculate Extended Checksum
//
- if ((ExtendedTableLength > sizeof(CPU_MICROCODE_EXTENDED_TABLE_HEADER)) && ((ExtendedTableLength & 0x3) != 0)) {
+ if ((ExtendedTableLength > sizeof(CPU_MICROCODE_EXTENDED_TABLE_HEADER)) && ((ExtendedTableLength & 0x3) == 0)) {
CheckSum32 = CalculateSum32((UINT32 *)ExtendedTableHeader, ExtendedTableLength);
if (CheckSum32 == 0) {
//