summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library/UefiBootManagerLib
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2015-09-09 05:43:44 +0000
committerniruiyu <niruiyu@Edk2>2015-09-09 05:43:44 +0000
commit88cbb6be4e68f50673cfaede8814b669957f51c8 (patch)
treebdbf419db1f422f1758e9db389aba3234f9125b9 /MdeModulePkg/Library/UefiBootManagerLib
parent8337590c42df0b0f89487077326a62768e7434ab (diff)
downloadedk2-platforms-88cbb6be4e68f50673cfaede8814b669957f51c8.tar.xz
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.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
Diffstat (limited to 'MdeModulePkg/Library/UefiBootManagerLib')
-rw-r--r--MdeModulePkg/Library/UefiBootManagerLib/BmPerformance.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmPerformance.c b/MdeModulePkg/Library/UefiBootManagerLib/BmPerformance.c
index 7b13ec663c..e45c0bd23a 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmPerformance.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmPerformance.c
@@ -186,6 +186,11 @@ BmWriteBootToOsPerformanceData (
PERF_END(NULL, "BDS", NULL, 0);
//
+ // Reset the entry count
+ //
+ mBmPerfHeader.Count = 0;
+
+ //
// Retrieve time stamp count as early as possible
//
Ticker = GetPerformanceCounter ();