Revision: 18417 http://sourceforge.net/p/edk2/code/18417 Author: niruiyu Date: 2015-09-09 05:43:44 +0000 (Wed, 09 Sep 2015) Log Message: ----------- MdeModulePkg: Fix a performance data buffer overrun issue
The mBmPerfHeader.Count isn't reset to 0 in BmWriteBootToOsPerformanceData() so when the actual performance data entry count exceeds the LimitCount, the performance data collection breaks on condition if (mBmPerfHeader.Count == LimitCount), but 2nd time calling this function will not break on condition if (mBmPerfHeader.Count == LimitCount) because the mBmPerfHeader.Count always bigger than LimitCount, which results buffer overrun. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu...@intel.com> Reviewed-by: Star Zeng <star.z...@intel.com> Modified Paths: -------------- trunk/edk2/MdeModulePkg/Library/UefiBootManagerLib/BmPerformance.c Modified: trunk/edk2/MdeModulePkg/Library/UefiBootManagerLib/BmPerformance.c =================================================================== --- trunk/edk2/MdeModulePkg/Library/UefiBootManagerLib/BmPerformance.c 2015-09-09 04:57:05 UTC (rev 18416) +++ trunk/edk2/MdeModulePkg/Library/UefiBootManagerLib/BmPerformance.c 2015-09-09 05:43:44 UTC (rev 18417) @@ -186,6 +186,11 @@ PERF_END(NULL, "BDS", NULL, 0); // + // Reset the entry count + // + mBmPerfHeader.Count = 0; + + // // Retrieve time stamp count as early as possible // Ticker = GetPerformanceCounter (); ------------------------------------------------------------------------------ Monitor Your Dynamic Infrastructure at Any Scale With Datadog! Get real-time metrics from all of your servers, apps and tools in one place. SourceForge users - Click here to start your Free Trial of Datadog now! http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140 _______________________________________________ edk2-commits mailing list edk2-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-commits