From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=jiewen.yao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 E2028210ED796 for ; Mon, 13 Aug 2018 05:47:21 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Aug 2018 05:47:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,233,1531810800"; d="scan'208";a="81308583" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga001.jf.intel.com with ESMTP; 13 Aug 2018 05:45:48 -0700 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 13 Aug 2018 05:45:45 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX153.amr.corp.intel.com (10.18.125.6) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 13 Aug 2018 05:45:44 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.226]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.205]) with mapi id 14.03.0319.002; Mon, 13 Aug 2018 20:45:42 +0800 From: "Yao, Jiewen" To: "Zeng, Star" , "edk2-devel@lists.01.org" CC: Anbazhagan Baraneedharan Thread-Topic: [PATCH] MdeModulePkg SmmLockBox: Return actual data length in SmmLockBoxRestore Thread-Index: AQHUMuNTAJ0x28fHgU+turw+eY2kgaS9oUEA Date: Mon, 13 Aug 2018 12:45:41 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503AD07332@shsmsx102.ccr.corp.intel.com> References: <1534150497-106396-1-git-send-email-star.zeng@intel.com> In-Reply-To: <1534150497-106396-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNGNjOTc1YzMtMzBhNS00NDFlLWJjZWQtNzBiOWY0YmFmZjExIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoib241TlUyUENRT2NSSjZTR3diXC9aaDgyb284V2RPR1pqMmVMVVdzc1hcL2t6V1Z6VXFQT2xYbTl2WnNXQURpdzN1In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] MdeModulePkg SmmLockBox: Return actual data length in SmmLockBoxRestore X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Aug 2018 12:47:22 -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: Monday, August 13, 2018 4:55 PM > To: edk2-devel@lists.01.org > Cc: Zeng, Star ; Yao, Jiewen ; > Anbazhagan Baraneedharan > Subject: [PATCH] MdeModulePkg SmmLockBox: Return actual data length in > SmmLockBoxRestore >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1082 >=20 > Current code only returns actual data length in case of return status > buffer too small. > If caller provided a buffer that's large enough to restore data from > lock box, actual data length is not returned. It needs to be updated > in case of return status as success as well. >=20 > Cc: Jiewen Yao > Cc: Anbazhagan Baraneedharan > 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 28d5180e011e..5a11743cb921 100644 > --- a/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c > +++ b/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.c > @@ -217,7 +217,10 @@ SmmLockBoxRestore ( > (VOID *)(UINTN)TempLockBoxParameterRestore.Buffer, > (UINTN *)&TempLockBoxParameterRestore.Length > ); > - if (Status =3D=3D EFI_BUFFER_TOO_SMALL) { > + if ((Status =3D=3D EFI_BUFFER_TOO_SMALL) || (Status =3D=3D EFI_SUCCE= SS)) { > + // > + // Return the actual Length value. > + // > LockBoxParameterRestore->Length =3D > TempLockBoxParameterRestore.Length; > } > } > -- > 2.7.0.windows.1