]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg SmmLockBox: Return updated Length for EFI_BUFFER_TOO_SMALL
authorStar Zeng <star.zeng@intel.com>
Sat, 24 Feb 2018 08:02:07 +0000 (16:02 +0800)
committerStar Zeng <star.zeng@intel.com>
Mon, 26 Feb 2018 06:03:23 +0000 (14:03 +0800)
The updated Length value should be returned
for EFI_BUFFER_TOO_SMALL case.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c

index 2dc8815f2eb5f60cefaadf6c3b74aba1bec04cc4..d4183ca4b05796b48cc18e3e7d9b33835d3bc91f 100644 (file)
@@ -9,7 +9,7 @@
   SmmLockBoxHandler(), SmmLockBoxRestore(), SmmLockBoxUpdate(), SmmLockBoxSave()\r
   will receive untrusted input and do basic validation.\r
 \r
   SmmLockBoxHandler(), SmmLockBoxRestore(), SmmLockBoxUpdate(), SmmLockBoxSave()\r
   will receive untrusted input and do basic validation.\r
 \r
-Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>\r
 \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
 \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
@@ -217,6 +217,9 @@ SmmLockBoxRestore (
                (VOID *)(UINTN)TempLockBoxParameterRestore.Buffer,\r
                (UINTN *)&TempLockBoxParameterRestore.Length\r
                );\r
                (VOID *)(UINTN)TempLockBoxParameterRestore.Buffer,\r
                (UINTN *)&TempLockBoxParameterRestore.Length\r
                );\r
+    if (Status == EFI_BUFFER_TOO_SMALL) {\r
+      LockBoxParameterRestore->Length = TempLockBoxParameterRestore.Length;\r
+    }\r
   }\r
   LockBoxParameterRestore->Header.ReturnStatus = (UINT64)Status;\r
   return ;\r
   }\r
   LockBoxParameterRestore->Header.ReturnStatus = (UINT64)Status;\r
   return ;\r