summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/FaultTolerantWriteDxe
AgeCommit message (Collapse)AuthorFilesLines
2013-07-11MdeModulePkg: Add the alignment check for FTW spare area address and length, ↵Star Zeng4-2/+19
and add the check for PcdFlashNvStorageVariableSize <= PcdFlashNvStorageFtwSpareSize. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14463 6f19259b-4bc3-4df7-8a09-765794883524
2013-07-03MdeModulePkg: Variable drivers robustly handle crashes during Reclaim().Star Zeng6-70/+33
PEI variable implementation checks only the variable header signature for validity. This does not seem robust if system crash occurred during previous Reclaim() operation. If the crash occurred while FTW was rewriting the variable FV, the signature could be valid even though the rest of the FV isn't valid. Solution: Add a FaultTolerantWritePei driver to check and provide the FTW last write status, then PEI variable and early phase(before FTW protocol ready) of DXE variable can check the status and determine if all or partial variable data has been backed up in spare block, and then use the backed up data. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14454 6f19259b-4bc3-4df7-8a09-765794883524
2013-06-07Use right LBA to get the backed up WorkSpace in spare block.Star Zeng1-3/+5
Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14398 6f19259b-4bc3-4df7-8a09-765794883524
2013-05-21Fix the TOCTOU issue of CommBufferSize itself for SMM communicate handler input.lzeng141-4/+6
Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14379 6f19259b-4bc3-4df7-8a09-765794883524
2013-05-071. Fix TOCTOU issue in VariableSmm, FtwSmm, FpdtSmm, SmmCorePerformance SMM ↵lzeng142-31/+73
handler. For VariableSmm, pre-allocate a mVariableBufferPayload buffer with mVariableBufferPayloadSize(match with mVariableBufferPayloadSize in VariableSmmRuntimeDxe) to hold communicate buffer payload to avoid TOCTOU issue. 2. Add check to ensure CommBufferPayloadSize not exceed mVariableBufferPayloadSize or is enough to hold function structure in VariableSmm and FtwSmm. 3. Align FtwGetLastWrite() in FaultTolerantWriteSmmDxe.c to FtwGetLastWrite() in FaultTolerantWrite.c. Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14325 6f19259b-4bc3-4df7-8a09-765794883524
2013-04-251. Use the check IsAddressValid() to prevent SMM communication buffer ↵lzeng141-2/+28
overflow in SmmVariable, FtwSmm, FpdtSmm, SmmCorePerformance and SmmBaseHelper, and add check to prevent InfoSize overflows in SmmVariableHandler. 2. Refine the debug message. 3. Add check to make sure the input VariableName is A Null-terminated string. 4. Use local variable to hold StrSize (VariableName) to avoid duplicated StrSize calculation. Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Chao Zhang <chao.b.zhang@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14317 6f19259b-4bc3-4df7-8a09-765794883524
2013-04-24Mallicious code may use SmmFaultTolerantWriteHandler() to update some flash ↵lzeng143-5/+63
area directly, like Variable region, so return EFI_ACCESS_DENIED after End Of Dxe in SmmFaultTolerantWriteHandler(). And add code to prevent InfoSize overflow. Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14312 6f19259b-4bc3-4df7-8a09-765794883524
2012-12-21Initialize a local work space header to be used by IsValidWorkSpace() and ↵lzeng143-82/+71
InitWorkSpaceHeader() to avoid executing code(gBS->CalculateCrc32 ()) outside SMRAM while inside SMM. Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14012 6f19259b-4bc3-4df7-8a09-765794883524
2012-12-17Reclaim work space when the remaining space size is even not enough to ↵lzeng141-1/+10
contain one header + one record. Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14005 6f19259b-4bc3-4df7-8a09-765794883524
2012-11-01MdeModulePkg: eliminate all implicit library dependencies for all modules in ↵erictian3-3/+4
MdeModulePkg on PcdLib Signed-off-by: Tian Feng <feng.tian@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13909 6f19259b-4bc3-4df7-8a09-765794883524
2012-09-28Add more exact SMM check in SmmFaultTolerantWriteHandler.lzeng141-17/+44
Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Elvin Li <elvin.li@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13763 6f19259b-4bc3-4df7-8a09-765794883524
2012-09-14Fix the issue that FTW driver fail to reclaim WorkSpace.lzeng144-20/+31
Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Hengyan Tao <hengyan.tao@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13732 6f19259b-4bc3-4df7-8a09-765794883524
2012-07-10Add SMRAM range check to fault tolerant write SMM SMI handler.ydong102-14/+88
Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13518 6f19259b-4bc3-4df7-8a09-765794883524
2012-05-11The code line where judges if offset exceed the FTW work space boundary, in ↵lzeng141-2/+2
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
2011-03-14Enhance inf and dec file to follow specs.ydong102-3/+3
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11392 6f19259b-4bc3-4df7-8a09-765794883524
2011-03-08Add missing .h file to INF filegdong11-1/+2
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11351 6f19259b-4bc3-4df7-8a09-765794883524
2011-02-16update comments and correct reclaim algorithm if there is no record existing ↵erictian2-5/+5
in FTW working block. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11318 6f19259b-4bc3-4df7-8a09-765794883524
2011-01-16Fixed 3 ECC errors.gdong11-5/+5
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11253 6f19259b-4bc3-4df7-8a09-765794883524
2011-01-12Add SMM FTW wrapper driver since non-SMM FTW protocol can be used by some ↵gdong15-10/+1129
consumers (Such as capsule update) when SMM FTW driver is applied. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11246 6f19259b-4bc3-4df7-8a09-765794883524
2010-12-15Update inappropriate comments.gdong12-5/+5
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11170 6f19259b-4bc3-4df7-8a09-765794883524
2010-12-10Add SMM Variable implementation.gdong17-474/+1050
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11151 6f19259b-4bc3-4df7-8a09-765794883524
2010-07-22Add 64-bit versions of FLASH Base addressess as it is legal to have them ↵andrewfish2-3/+13
>4G. For backward compatability if the new 64-bit base addresses are zero use the old 32-bit base addressess. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10684 6f19259b-4bc3-4df7-8a09-765794883524
2010-04-24Update the copyright notice formathhtian5-10/+10
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10418 6f19259b-4bc3-4df7-8a09-765794883524
2010-02-26Add more code robustness check for modules under MdeModulePkg.rsun31-1/+2
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10108 6f19259b-4bc3-4df7-8a09-765794883524
2010-02-241. Correct File header to ## @filelgao41-4/+4
2. Remove unnecessary .common] postfix on section. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10052 6f19259b-4bc3-4df7-8a09-765794883524
2010-01-15Fix some coding style issues in MdeModulePkg.rsun31-0/+8
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9774 6f19259b-4bc3-4df7-8a09-765794883524
2009-09-26Allow the FaultTolerantWriteDxe addresses to be dynamic PCD's.jljusten1-2/+3
PcdFlashNvStorageFtwWorkingBase and PcdFlashNvStorageFtwSpareBase are now updated each time an FVB instance is installed. This allows the PCDs to be set at runtime at any time before the FVB is installed. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9312 6f19259b-4bc3-4df7-8a09-765794883524
2009-03-24correct a wrong offset arithmetic, replace EFI_FAULT_TOLERANT_WRITE_HEADER ↵eric_tian1-1/+1
with EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER. It will cause FTW write operation break. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7931 6f19259b-4bc3-4df7-8a09-765794883524
2009-03-12retire gEfiAlternateFvBlockGuid. All platform FvbRuntimeDxe drivers will not ↵eric_tian3-173/+179
produce such protocol to signify itself support writable FVB protocol. FaultTolerantWrite driver and variable driver will register notification event to locate right protocol. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7865 6f19259b-4bc3-4df7-8a09-765794883524
2009-03-10Fix K8 check error.lgao41-12/+6
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7849 6f19259b-4bc3-4df7-8a09-765794883524
2009-03-04Add full version FaultTolerantWrite Dxe driver.lgao45-0/+3438
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7787 6f19259b-4bc3-4df7-8a09-765794883524