From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.151; helo=mga17.intel.com; envelope-from=jiewen.yao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D06AC20955F21 for ; Sun, 25 Feb 2018 19:36:54 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Feb 2018 19:42:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,395,1515484800"; d="scan'208";a="30631985" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga003.jf.intel.com with ESMTP; 25 Feb 2018 19:42:58 -0800 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 25 Feb 2018 19:42:58 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 25 Feb 2018 19:42:58 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.124]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.125]) with mapi id 14.03.0319.002; Mon, 26 Feb 2018 11:42:56 +0800 From: "Yao, Jiewen" To: "Zeng, Star" , "edk2-devel@lists.01.org" Thread-Topic: [PATCH] MdeModulePkg SmmLockBox: Return updated Length for EFI_BUFFER_TOO_SMALL Thread-Index: AQHTrVk0d67UXUStDUuwKeCb/T9ESaO2DQgA Date: Mon, 26 Feb 2018 03:42:55 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503AAD05CE@shsmsx102.ccr.corp.intel.com> References: <1519467672-11360-1-git-send-email-star.zeng@intel.com> In-Reply-To: <1519467672-11360-1-git-send-email-star.zeng@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYmYwYmYxNzctYzU1ZS00YjVjLTg5MGQtYmY4MDdmNGM0ZTBlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJmeDVwVzcyUlwvclY3T2Y4TFNQU1BWYVdsRnFocUVZNWducTBmS1VvY2EwZGtnVXhXbDQzbzN2NW1PNlZBOCtDMyJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] MdeModulePkg SmmLockBox: Return updated Length for EFI_BUFFER_TOO_SMALL X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Feb 2018 03:36:55 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jiewen.yao@intel.com > -----Original Message----- > From: Zeng, Star > Sent: Saturday, February 24, 2018 6:21 PM > To: edk2-devel@lists.01.org > Cc: Zeng, Star ; Yao, Jiewen > Subject: [PATCH] MdeModulePkg SmmLockBox: Return updated Length for > EFI_BUFFER_TOO_SMALL >=20 > The updated Length value should be returned > for EFI_BUFFER_TOO_SMALL case. >=20 > Cc: Jiewen Yao > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Star Zeng > --- > MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) >=20 > diff --git a/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c > b/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c > index 2dc8815f2eb5..d4183ca4b057 100644 > --- a/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c > +++ b/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c > @@ -9,7 +9,7 @@ > SmmLockBoxHandler(), SmmLockBoxRestore(), SmmLockBoxUpdate(), > SmmLockBoxSave() > will receive untrusted input and do basic validation. >=20 > -Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
> +Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
>=20 > This program and the accompanying materials > are licensed and made available under the terms and conditions > @@ -217,6 +217,9 @@ SmmLockBoxRestore ( > (VOID *)(UINTN)TempLockBoxParameterRestore.Buffer, > (UINTN *)&TempLockBoxParameterRestore.Length > ); > + if (Status =3D=3D EFI_BUFFER_TOO_SMALL) { > + LockBoxParameterRestore->Length =3D > TempLockBoxParameterRestore.Length; > + } > } > LockBoxParameterRestore->Header.ReturnStatus =3D (UINT64)Status; > return ; > -- > 2.7.0.windows.1