Revision: 18420
          http://sourceforge.net/p/edk2/code/18420
Author:   hwu1225
Date:     2015-09-09 07:50:09 +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.

(Sync patch r18417 from main trunk.)

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <[email protected]>
Reviewed-by: Star Zeng <[email protected]>

Revision Links:
--------------
    http://sourceforge.net/p/edk2/code/18417

Modified Paths:
--------------
    branches/UDK2015/MdeModulePkg/Library/UefiBootManagerLib/BmPerformance.c

Modified: 
branches/UDK2015/MdeModulePkg/Library/UefiBootManagerLib/BmPerformance.c
===================================================================
--- branches/UDK2015/MdeModulePkg/Library/UefiBootManagerLib/BmPerformance.c    
2015-09-09 06:29:14 UTC (rev 18419)
+++ branches/UDK2015/MdeModulePkg/Library/UefiBootManagerLib/BmPerformance.c    
2015-09-09 07:50:09 UTC (rev 18420)
@@ -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
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to