diff options
author | Zhang, Chao B <chao.b.zhang@intel.com> | 2018-07-19 17:56:38 +0800 |
---|---|---|
committer | Zhang, Chao B <chao.b.zhang@intel.com> | 2018-07-21 09:46:49 +0800 |
commit | 831bb137a88a578262cf28d60096ad563bad3f7c (patch) | |
tree | 779b74b70810a8f804edc65e31873c56ab9cf63f /SecurityPkg/Tcg | |
parent | 2aa4fb10a574a62dfb02bba15a2934e8bd83d2a1 (diff) | |
download | edk2-831bb137a88a578262cf28d60096ad563bad3f7c.zip edk2-831bb137a88a578262cf28d60096ad563bad3f7c.tar.gz edk2-831bb137a88a578262cf28d60096ad563bad3f7c.tar.bz2 |
SecurityPkg: TcgSmm: Handle invalid parameter in MOR SMI handler
Add more logic to filter invalid function parameter in MOR Control SMI handler
Cc: Long Qin <qin.long@intel.com>
Cc: Yao Jiewen <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Long Qin <qin.long@intel.com>
Diffstat (limited to 'SecurityPkg/Tcg')
-rw-r--r-- | SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c | 4 | ||||
-rw-r--r-- | SecurityPkg/Tcg/TcgSmm/TcgSmm.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c index 21b1014..4a1a293 100644 --- a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c +++ b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c @@ -153,6 +153,10 @@ MemoryClearCallback ( return EFI_SUCCESS;
}
MorControl &= ~MOR_CLEAR_MEMORY_BIT_MASK;
+ } else {
+ mTcgNvs->MemoryClear.ReturnCode = MOR_REQUEST_GENERAL_FAILURE;
+ DEBUG ((EFI_D_ERROR, "[TPM] MOR Parameter error! Parameter = %x\n", mTcgNvs->MemoryClear.Parameter));
+ return EFI_SUCCESS;
}
DataSize = sizeof (UINT8);
diff --git a/SecurityPkg/Tcg/TcgSmm/TcgSmm.c b/SecurityPkg/Tcg/TcgSmm/TcgSmm.c index 0b8a002..d3ddae6 100644 --- a/SecurityPkg/Tcg/TcgSmm/TcgSmm.c +++ b/SecurityPkg/Tcg/TcgSmm/TcgSmm.c @@ -271,6 +271,10 @@ MemoryClearCallback ( return EFI_SUCCESS;
}
MorControl &= ~MOR_CLEAR_MEMORY_BIT_MASK;
+ } else {
+ mTcgNvs->MemoryClear.ReturnCode = MOR_REQUEST_GENERAL_FAILURE;
+ DEBUG ((EFI_D_ERROR, "[TPM] MOR Parameter error! Parameter = %x\n", mTcgNvs->MemoryClear.Parameter));
+ return EFI_SUCCESS;
}
DataSize = sizeof (UINT8);
|