diff options
author | Star Zeng <star.zeng@intel.com> | 2018-01-05 13:05:29 +0800 |
---|---|---|
committer | Jian J Wang <jian.j.wang@intel.com> | 2019-02-28 18:22:52 +0800 |
commit | 467e1ffa7634159b99fb8aeb93e2836b0f2e5f43 (patch) | |
tree | 28b006b7ebba9806a54f2c0a8e4f0f2dcd417aec | |
parent | 3a4698202cf5ca81d4401bdc6c0974400064f333 (diff) | |
download | edk2-467e1ffa7634159b99fb8aeb93e2836b0f2e5f43.tar.gz edk2-467e1ffa7634159b99fb8aeb93e2836b0f2e5f43.tar.bz2 edk2-467e1ffa7634159b99fb8aeb93e2836b0f2e5f43.zip |
MdeModulePkg/PeiCore: Ensure FfsFileHeader 8 bytes aligned
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=864
REF: CVE-2018-3630
To follow PI spec, ensure FfsFileHeader 8 bytes aligned.
Current code only handles (FwVolHeader->ExtHeaderOffset != 0) path,
update code to also handle (FwVolHeader->ExtHeaderOffset == 0) path.
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
-rw-r--r-- | MdeModulePkg/Core/Pei/FwVol/FwVol.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.c b/MdeModulePkg/Core/Pei/FwVol/FwVol.c index 0a67b96bf1..56440eacf0 100644 --- a/MdeModulePkg/Core/Pei/FwVol/FwVol.c +++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.c @@ -2,7 +2,7 @@ Pei Core Firmware File System service routines.
Copyright (c) 2015 HP Development Company, L.P.
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2019, 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
@@ -316,10 +316,10 @@ FindFileEx ( //
FwVolExtHeader = (EFI_FIRMWARE_VOLUME_EXT_HEADER *) ((UINT8 *) FwVolHeader + FwVolHeader->ExtHeaderOffset);
FfsFileHeader = (EFI_FFS_FILE_HEADER *) ((UINT8 *) FwVolExtHeader + FwVolExtHeader->ExtHeaderSize);
- FfsFileHeader = (EFI_FFS_FILE_HEADER *) ALIGN_POINTER (FfsFileHeader, 8);
} else {
FfsFileHeader = (EFI_FFS_FILE_HEADER *)((UINT8 *) FwVolHeader + FwVolHeader->HeaderLength);
}
+ FfsFileHeader = (EFI_FFS_FILE_HEADER *) ALIGN_POINTER (FfsFileHeader, 8);
} else {
if (IS_FFS_FILE2 (*FileHeader)) {
if (!IsFfs3Fv) {
|