]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Fix a performance data buffer overrun issue
authorRuiyu Ni <ruiyu.ni@intel.com>
Wed, 9 Sep 2015 05:43:44 +0000 (05:43 +0000)
committerniruiyu <niruiyu@Edk2>
Wed, 9 Sep 2015 05:43:44 +0000 (05:43 +0000)
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.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18417 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Library/UefiBootManagerLib/BmPerformance.c

index 7b13ec663c68f8c62ac9c98a4d45aae441d41595..e45c0bd23a5b3c4f735ba74ecc731ec3f4ef2564 100644 (file)
@@ -185,6 +185,11 @@ BmWriteBootToOsPerformanceData (
   //\r
   PERF_END(NULL, "BDS", NULL, 0);\r
 \r
+  //\r
+  // Reset the entry count\r
+  //\r
+  mBmPerfHeader.Count = 0;\r
+\r
   //\r
   // Retrieve time stamp count as early as possible\r
   //\r