summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhang, Chao B <chao.b.zhang@intel.com>2016-07-01 10:32:27 +0800
committerZhang, Chao B <chao.b.zhang@intel.com>2016-07-01 10:33:47 +0800
commite1f3583409e7fa5041be829440f0139b1a70c3c4 (patch)
tree8174b4dfdcdba102a139ad4dea060dfb895b5ecf
parent1d9869f9e91605f6c099237eeb3414887f1258a9 (diff)
downloadedk2-e1f3583409e7fa5041be829440f0139b1a70c3c4.tar.gz
edk2-e1f3583409e7fa5041be829440f0139b1a70c3c4.tar.bz2
edk2-e1f3583409e7fa5041be829440f0139b1a70c3c4.zip
SecurityPkg/Tcg: Fix bug that prevented SubmitCommand buffers from being Max size
SubmitCommand() was checking the buffer size for ">=" Max size. This would cause code to fail with "EFI_INVALID_PARAMETER" if a buffer was passed that was the "max" size as indicated by the GetCapability() command. Change to ">" to allow for maximum buffer size. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Bret Barkelew <brbarkel@microsoft.com> Reviewed-by: Yao Jiewen <jiewen.yao@intel.com> Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
-rw-r--r--SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c4
-rw-r--r--SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
index bdff5bd598..7720c2708d 100644
--- a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
+++ b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
@@ -1330,10 +1330,10 @@ Tcg2SubmitCommand (
return EFI_DEVICE_ERROR;
}
- if (InputParameterBlockSize >= mTcgDxeData.BsCap.MaxCommandSize) {
+ if (InputParameterBlockSize > mTcgDxeData.BsCap.MaxCommandSize) {
return EFI_INVALID_PARAMETER;
}
- if (OutputParameterBlockSize >= mTcgDxeData.BsCap.MaxResponseSize) {
+ if (OutputParameterBlockSize > mTcgDxeData.BsCap.MaxResponseSize) {
return EFI_INVALID_PARAMETER;
}
diff --git a/SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c b/SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c
index dfdee04688..a30cd5161d 100644
--- a/SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c
+++ b/SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c
@@ -893,10 +893,10 @@ TreeSubmitCommand (
return EFI_UNSUPPORTED;
}
- if (InputParameterBlockSize >= mTcgDxeData.BsCap.MaxCommandSize) {
+ if (InputParameterBlockSize > mTcgDxeData.BsCap.MaxCommandSize) {
return EFI_INVALID_PARAMETER;
}
- if (OutputParameterBlockSize >= mTcgDxeData.BsCap.MaxResponseSize) {
+ if (OutputParameterBlockSize > mTcgDxeData.BsCap.MaxResponseSize) {
return EFI_INVALID_PARAMETER;
}