From nobody Thu Dec 26 01:05:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1506331065927696.6522519294006; Mon, 25 Sep 2017 02:17:45 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 4A86021E43B63; Mon, 25 Sep 2017 02:14:33 -0700 (PDT) Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0083.outbound.protection.outlook.com [104.47.33.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id DBC5821E1B75E for ; Mon, 25 Sep 2017 02:14:31 -0700 (PDT) Received: from BLUPR0301CA0023.namprd03.prod.outlook.com (10.162.113.161) by BN3PR03MB2354.namprd03.prod.outlook.com (10.166.74.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Mon, 25 Sep 2017 09:17:41 +0000 Received: from BN1BFFO11FD006.protection.gbl (2a01:111:f400:7c10::1:107) by BLUPR0301CA0023.outlook.office365.com (2a01:111:e400:5259::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.8 via Frontend Transport; Mon, 25 Sep 2017 09:17:34 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD006.mail.protection.outlook.com (10.58.144.69) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.35.14 via Frontend Transport; Mon, 25 Sep 2017 09:17:34 +0000 Received: from uefi-OptiPlex-790.ap.freescale.net (uefi-OptiPlex-790.ap.freescale.net [10.232.132.78]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v8P9HURw010982; Mon, 25 Sep 2017 02:17:30 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=104.47.33.83; helo=nam01-bn3-obe.outbound.protection.outlook.com; envelope-from=meenakshi.aggarwal@nxp.com; receiver=edk2-devel@lists.01.org Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; From: Meenakshi Aggarwal To: , , Date: Mon, 25 Sep 2017 20:36:02 +0530 Message-ID: <1506351962-28200-1-git-send-email-meenakshi.aggarwal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1506350249-28082-1-git-send-email-meenakshi.aggarwal@nxp.com> References: <1506350249-28082-1-git-send-email-meenakshi.aggarwal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131508046549273089; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(346002)(376002)(39380400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(47776003)(8656003)(2201001)(50226002)(50986999)(105606002)(76176999)(48376002)(106466001)(85426001)(2906002)(305945005)(50466002)(53936002)(5003940100001)(104016004)(8936002)(356003)(33646002)(4326008)(81156014)(8676002)(68736007)(498600001)(86362001)(189998001)(2950100002)(7416002)(81166006)(6666003)(97736004)(5660300001)(77096006)(110136005)(54906003)(16586007)(36756003)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR03MB2354; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD006; 1:L1BMO5x/w41sEhN/vtUkOxVCD55HcboMTC1CPXiaX9Hum8SYmrMTOwXuvEa137xlQf8RX3RjzUfc/b6tQxDAKDc9kRdmxQrRULB662vkLdFRWutExYy+pgyktyUMaypU MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 41359bf2-bc2d-4586-68a1-08d503f64221 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017052603199)(201703131430075)(201703131517081); SRVR:BN3PR03MB2354; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2354; 3:A/zCQS9txdmJ4dcmAdpmQv4gHuzJy++nMXL5TpKLEGYEgNr2NoKsf/es9atNj+9veIFiJ+EhqMB7F9Qgc2Cw3z16twZRuY6EYchV7uY7rw/XZw/cMowLDP1+zHnP20R23x+2lSJh5WowiVAd0c3vn/IEzBUA4JJx5lcIuqUcL8TSqAZkvHsD7hIe8iUwk3vbHKL/LWyAVOkUUwpNxgjd1YEHGzgHGVM9uU7zyCOIp5J+Hnuqw6ot8P9fQBEeVJ6EB7e7h+nhxughfsSKGnXWPcepQDTJaigIE/CjoQnn2Ary1dd9T7U9qrU9FxXCPuZCvU5LCsirQT/mTuR4vuvz/RJxfc/flVRToFHNGZdR2Jk=; 25:40Be8IC8chxGsvl3xnyWkyxi4Oq1x75YAWOvyE8jpwjaIpesxk7Ld2W96PrIKyu0I5JMXdiMexf2J1nF77D6hSZr30MUfbrOt4E2Di6N/PNsHhtKmz+SLD6Xhi/+DfBjEjMJsVeePTc4fiEUhhnaKX6rKmhzfWJ31rCUyqgE4vapTaCrjEBuaffaPCWWAP0ALokhF+DvimzmGajXBKTvAV+li/DT/QdkQQ9Q2Mn948BWdpGHeb+tJIqbrs4is4VFIV/giOvV9HmjU5Dt4WCd/jzegADePUohBt32/QhEVSvAUpJ5moOANJQDYc1k56+rp4Ns1XYsmj3OkfV7iP0VKg== X-MS-TrafficTypeDiagnostic: BN3PR03MB2354: X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2354; 31:6PHt4kKPhPOcgedF/5A0dgDiqiyqZu9Nkaj7UWMW+b5N9v9JVttA+R57RfaeoOAmoTFQscoy7oEJD1bhew8TDhA+exzFOS6QJ79bicHVTnFwNdzVh19PhkPZGKCehMhaCNG2e3TkVJyavEE7Q+gW6qamug35HY0/AxXYl8rOcoAXKKejsfej1lhhHSbkShP0ipYAmFa4H1is5IGEbEImMTlZIUkc1sIPeRp/GtYv5tE=; 4:CRnwvDYxkinl+PcmqWi6wrizMKQpezeYmdVYqfxl+NB1vZkF/wxyVS2oE90HvYo33Yo6JsODdqPLwIus++7u8LcVaHRVTkoJCjDOWuODyzQMLmrnKGJxFcuApDeemKeb//4FvqZhobr2ELx3Of5TDaMi+lFYxBHSOBqzx3GAUq9WQwcpj9hfK+abvjN+4J+y/Ekwsz7kH9DZDx/fvePEWvRo3eygbrAltdxssdfNUuw27nu02sCDxNMfspYUj/OpOgGeQoXhtIVcEqtO2ZdwW6Hqv525ASuAn5dweCZOvdU= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(2401047)(8121501046)(5005006)(3002001)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(6055026)(6096035)(20161123559100)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123561025)(20161123556025)(20161123565025)(20161123563025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN3PR03MB2354; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN3PR03MB2354; X-Forefront-PRVS: 04410E544A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR03MB2354; 23:22eJAqE7C9VhIxOlrw77aXab5IR7xJnD1Izltdq5W?= =?us-ascii?Q?GzT1xMINKx86BdoVmlzTYanZa6Xfv99b2jH4vYWeiIVBYRBBypdmx269xBho?= =?us-ascii?Q?uUBFTAseakjNu7yaAUrlCpognsKEtQMPo2UxlXEbs6Ev+RRnRVsQxd7cqWtm?= =?us-ascii?Q?J6RiASwjPHcOCTKyqG+3GCahRjxvZAYJlPv554gmyxmxkpXLUXlIqIzVmpQk?= =?us-ascii?Q?SG3uZLpiaLtH+XEIiKDmIchy1eRnpza+9Zwk+2ZbNDeluVq+sa9B44WXQdVG?= =?us-ascii?Q?Bj87HKZgSLiztXuM5PC8dBR2FCeekyHEMW/R3yV6esxZyYy5UDs73sEg+eUP?= =?us-ascii?Q?kGYk8mC4SmE13vkR+mUW4odhT0KLK8w+ODykT69KWhz17zsLBAR39wwNKgeq?= =?us-ascii?Q?TBy3OY5rmjmImQLc/vhkLEinUVpXV4ZGo0Jo+HFhp+3aT/0khrLoJiJ0x33N?= =?us-ascii?Q?xvCTimCodDrd36tppNuRamm2yuFdotFo9F/qhjKmxq8sclGZN5W8pUF8ncdL?= =?us-ascii?Q?7+rEoza/+Tvq+02owwIRUZyXFJWgycUP/Ga+S7hMQgZA9pXakGNyZYBFaQaY?= =?us-ascii?Q?SKURIDFLl0WIteaqE4gihjaYer33XvOJxQ4iIYM6R0GOKRagzcqnphJ/mtES?= =?us-ascii?Q?aduCQJlRXeKwwtagu1C73TVjYpDE2c8jrMYhTGzNapLnVFBYZ1tHuI3aZfkS?= =?us-ascii?Q?ag/nvRVeNNYoYs8uwLdUOUOge7RuwUBQqjXHG3YGhHPfsipTn4ey2pIYS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ulItnoM1NmZYA==; 24:KeRa/DcM3AyHF8hTRd35KyOiw7UD+bZzNkgIuNHMDki544Gve3+0BqfW7skHxqNkRhoPIA4/fq8fdERCzLEm5B47m83NjdYMIK6qC7EaOR0=; 7:LWjutrznRfSL3l18UPyImJ/noynIXHXzqUK9bv2gSvkVpIHfmWl50II3fHh3+aHDdUrSHPFVXuMp9pkj9dCMfIH1nD6GRu9Zbw7NEMLeyOqLmSQkuFDXr1jEKYP9OPB6zfF6YcsYKW/SaA6LfUsmyQ9LG0m5CLvFGA8l0qRsttoGNNUCnzbOdJ83GKQUwIRXRhjdabcC0XTNacAASA/hd97vSbhXoSucu6ISCONVkyE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2017 09:17:34.7089 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR03MB2354 Subject: [edk2] [PATCH v2] TFTP : tftp fix for full volume case X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ting.ye@intel.com, ard.biesheuvel@linaro.org, leif.lindholm@linaro.org, siyuan.fu@intel.com Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Issue : When storage media is full, tftp was resulting in ASSERT MdeModulePkg/Core/Dxe/Mem/Page.c, because number of pages was zero. Reason: While doing tftp, function call ShellWriteFile was modifying FileSize variable. In case of full disk it was coming out to be Zero. Fix: Storage the original filesize in local variable, and use this variable while freeing the pages. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Udit Kumar Signed-off-by: Meenakshi Aggarwal Signed-off-by: Vabhav Sharma Signed-off-by: Meenakshi Aggarwal Reviewed-by: Fu Siyuan Reviewed-by: Jaben Carsey Reviewed-by: Ruiyu Ni --- ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c b/ShellPkg/Lib= rary/UefiShellTftpCommandLib/Tftp.c index 5c50797..fbde3bf 100755 --- a/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c +++ b/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c @@ -284,6 +284,7 @@ ShellCommandRunTftp ( EFI_HANDLE Mtftp4ChildHandle; EFI_MTFTP4_PROTOCOL *Mtftp4; UINTN FileSize; + UINTN DataSize; VOID *Data; SHELL_FILE_HANDLE FileHandle; UINT16 BlockSize; @@ -294,6 +295,7 @@ ShellCommandRunTftp ( AsciiRemoteFilePath =3D NULL; Handles =3D NULL; FileSize =3D 0; + DataSize =3D 0; BlockSize =3D MTFTP_DEFAULT_BLKSIZE; =20 // @@ -537,6 +539,7 @@ ShellCommandRunTftp ( goto NextHandle; } =20 + DataSize =3D FileSize; Status =3D ShellWriteFile (FileHandle, &FileSize, Data); if (!EFI_ERROR (Status)) { ShellStatus =3D SHELL_SUCCESS; @@ -551,7 +554,7 @@ ShellCommandRunTftp ( NextHandle: =20 if (Data !=3D NULL) { - gBS->FreePages ((EFI_PHYSICAL_ADDRESS)(UINTN)Data, EFI_SIZE_TO_PAGES= (FileSize)); + gBS->FreePages ((EFI_PHYSICAL_ADDRESS)(UINTN)Data, EFI_SIZE_TO_PAGES= (DataSize)); } =20 CloseProtocolAndDestroyServiceChild ( --=20 1.9.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel