summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>2012-05-11 01:48:45 +0000
committerlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>2012-05-11 01:48:45 +0000
commitfe92f438ac860a09e57a2a6a37c1a1d8b6539321 (patch)
treebc77d4e1bfee37509e462dd11699ed103b823732
parent5d4f8cf3c9aace8ad3a37670629a88bb7b21a3f7 (diff)
downloadedk2-platforms-fe92f438ac860a09e57a2a6a37c1a1d8b6539321.tar.xz
The code line where judges if offset exceed the FTW work space boundary, in some special situations where there are so many records, the offset may happen to be just equal to FtwWorkSpaceSize. And then FtwHead will be updated to be outside of work space wrongly, and cause the system to hang in this driver.
Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13307 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c
index dc110a226d..482753f62c 100644
--- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c
+++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c
@@ -2,7 +2,7 @@
Internal generic functions to operate flash block.
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -777,7 +777,7 @@ FtwGetLastWriteHeader (
//
// If Offset exceed the FTW work space boudary, return error.
//
- if (Offset > FtwWorkSpaceSize) {
+ if (Offset >= FtwWorkSpaceSize) {
*FtwWriteHeader = FtwHeader;
return EFI_ABORTED;
}