Good catch.

Reviewed-by: [email protected]



> -----Original Message-----
> From: edk2-devel [mailto:[email protected]] On Behalf Of
> Bret Barkelew
> Sent: Tuesday, June 28, 2016 10:29 AM
> To: [email protected]
> Subject: [edk2] SecurityPkg/Tcg: Fix bug that prevented SubmitCommand
> buffers from being Max size.
> 
> 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
> <[email protected]<mailto:[email protected]>>
> 
> ---
> SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c | 4 ++--
> SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
> b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
> index bdff5bd..7720c27 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 dfdee04..a30cd51 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;
>    }
> 
> --
> 2.9.0.windows.1
> 
> _______________________________________________
> edk2-devel mailing list
> [email protected]
> https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to