audk/IntelFsp2Pkg
Ranbir Singh 48c53994e6 IntelFsp2Pkg/Library/BaseFspCommonLib: Fix OVERRUN Coverity issue
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4200

FspData->PerfIdx is getting increased for every call unconditionally
in the function SetFspMeasurePoint and hence memory access can happen
for out of bound FspData->PerfData[] array entries also.

Example -
   FspData->PerfData is an array of 32 UINT64 entries. Assume a call
   is made to SetFspMeasurePoint function when the FspData->PerfIdx
   last value is 31. It gets incremented to 32 at line 400.
   Any subsequent call to SetFspMeasurePoint functions leads to
   FspData->PerfData[32] getting accessed which is out of the PerfData
   array as well as the FSP_GLOBAL_DATA structure boundary.

Hence keep array access and index increment inside if block only and
return invalid performance timestamp when PerfIdx is invalid.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Signed-off-by: Ranbir Singh <rsingh@ventanamicro.com>
Acked-by: Pedro Falcato <pedro.falcato@gmail.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
2023-05-30 05:13:36 +00:00
..
FspNotifyPhase IntelFsp2Pkg: X64 compatible changes to support PEI in 64bit 2022-04-16 00:18:14 +00:00
FspSecCore IntelFsp2Pkg: LoadMicrocodeDefault() causing unnecessary delay. 2023-04-04 17:18:20 +00:00
Include IntelFsp2Pkg: TempRamInit API should preserve EBX/RBX register. 2023-04-04 16:39:41 +00:00
Library IntelFsp2Pkg/Library/BaseFspCommonLib: Fix OVERRUN Coverity issue 2023-05-30 05:13:36 +00:00
Tools IntelFsp2Pkg/Tools: Enhance PathFv.py to patch Fd file directly 2023-04-18 06:09:25 +00:00
IntelFsp2Pkg.ci.yaml IntelFsp2Pkg: Add CI YAML file 2022-10-04 16:53:59 +00:00
IntelFsp2Pkg.dec IntelFsp2Pkg: Add FSP 2.4 MultiPhase interface. 2022-08-31 16:48:07 +00:00
IntelFsp2Pkg.dsc IntelFsp2Pkg: Remove UefiCpuLib from module INFs. 2023-03-10 08:23:56 +00:00
Readme.md IntelFsp2Pkg: Convert files to CRLF line ending 2017-04-06 15:42:56 +08:00

Readme.md