diff options
author | Jeff Fan <jeff.fan@intel.com> | 2016-11-04 10:01:21 +0800 |
---|---|---|
committer | Jeff Fan <jeff.fan@intel.com> | 2016-11-09 16:00:32 +0800 |
commit | b028c1021cdfbfaa0202711f2a008c801752917f (patch) | |
tree | e27794035c10f6a634744ebc754e3d4e3904b508 /MdeModulePkg/Core | |
parent | af34c1064934b8c02dca1660408b9aa7898c0e5b (diff) | |
download | edk2-platforms-b028c1021cdfbfaa0202711f2a008c801752917f.tar.xz |
MdeModulePkg/DxeIplPeim: UINTN used wrongly for EFI_PHYSICAL_ADDRESS
PeiServicesAllocatePages () will output sizeof (EFI_PHYSICAL_ADDRESS) value.
IdtTableForX64 is sizeof (UINTN) local variable. It will overwrite other local
variable.
This issue is found when we dump BaseOfStack value.
Cc: Feng Tian <feng.tian@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Diffstat (limited to 'MdeModulePkg/Core')
-rw-r--r-- | MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c b/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c index 6ec51ff09a..8f6a97a174 100644 --- a/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c +++ b/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c @@ -280,7 +280,7 @@ HandOffToDxeCore ( Status = PeiServicesAllocatePages (
EfiBootServicesData,
EFI_SIZE_TO_PAGES(sizeof (X64_IDT_TABLE) + SizeOfTemplate * IDT_ENTRY_COUNT),
- (EFI_PHYSICAL_ADDRESS *) &IdtTableForX64
+ &VectorAddress
);
ASSERT_EFI_ERROR (Status);
@@ -288,6 +288,7 @@ HandOffToDxeCore ( // Store EFI_PEI_SERVICES** in the 4 bytes immediately preceding IDT to avoid that
// it may not be gotten correctly after IDT register is re-written.
//
+ IdtTableForX64 = (X64_IDT_TABLE *) (UINTN) VectorAddress;
IdtTableForX64->PeiService = GetPeiServicesTablePointer ();
VectorAddress = (EFI_PHYSICAL_ADDRESS) (UINTN) (IdtTableForX64 + 1);
|