From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Permerror (SPF Permanent Error: More than 10 MX records returned) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=siyuan.fu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 9B8832214E322 for ; Tue, 12 Dec 2017 17:20:37 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Dec 2017 17:25:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,395,1508828400"; d="scan'208";a="2337257" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga006.jf.intel.com with ESMTP; 12 Dec 2017 17:25:15 -0800 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 12 Dec 2017 17:25:12 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 12 Dec 2017 17:25:11 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.93]) with mapi id 14.03.0319.002; Wed, 13 Dec 2017 09:25:10 +0800 From: "Fu, Siyuan" To: "Wu, Jiaxin" , "edk2-devel@lists.01.org" CC: Heyi Guo , "Ye, Ting" Thread-Topic: [Patch] MdeModulePkg/UefiPxeBcDxe: Discard the normal ICMP packets and recycle the received ICMP data. Thread-Index: AQHTczwgklgZYVAFlEiMpi/WDnMaM6NAe+9g Date: Wed, 13 Dec 2017 01:25:09 +0000 Message-ID: References: <1513078001-5392-1-git-send-email-jiaxin.wu@intel.com> In-Reply-To: <1513078001-5392-1-git-send-email-jiaxin.wu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjM2ODQ2YWMtNWUyZi00Y2NlLWJiYmUtMzk3MmQxYjQ0YmMwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiIwVHMyM3RGanppNzRDUDB4TzdPdWZEYVVySzlCcXcxU3VxTFd3MkNMQ3pTRnA2M1RzcGJJUjFLTjhMVitOMEl0In0= 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/UefiPxeBcDxe: Discard the normal ICMP packets and recycle the received ICMP data. 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: , X-List-Received-Date: Wed, 13 Dec 2017 01:20:37 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Fu Siyuan > -----Original Message----- > From: Wu, Jiaxin > Sent: Tuesday, December 12, 2017 7:27 PM > To: edk2-devel@lists.01.org > Cc: Fu, Siyuan ; Heyi Guo ; Ye, > Ting > Subject: [Patch] MdeModulePkg/UefiPxeBcDxe: Discard the normal ICMP > packets and recycle the received ICMP data. >=20 > This patch is to discard the normal ICMP packets and recycle the received > ICMP data to avoid the memory leak. >=20 > Cc: Siyuan Fu > Cc: Heyi Guo > Cc: Ye Ting > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Jiaxin Wu > Tested-by: Heyi Guo > --- > MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c | 14 +++++++----= - > -- > 1 file changed, 7 insertions(+), 7 deletions(-) >=20 > diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c > b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c > index 6d4f33f..4bfeaf3 100644 > --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c > +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c > @@ -164,17 +164,19 @@ IcmpErrorListenHandlerDpc ( > // The reception is actively aborted by the consumer, directly retur= n. > // > return; > } >=20 > - if (EFI_ERROR (Status) || (RxData =3D=3D NULL)) { > + if (RxData =3D=3D NULL) { > + goto Resume; > + } > + > + if (Status !=3D EFI_ICMP_ERROR) { > // > - // Only process the normal packets and the icmp error packets, if > RxData is NULL > - // with Status =3D=3D EFI_SUCCESS or EFI_ICMP_ERROR, just resume the > receive although > - // this should be a bug of the low layer (IP). > + // The return status should be recognized as EFI_ICMP_ERROR. > // > - goto Resume; > + goto CleanUp; > } >=20 > if (EFI_IP4 (RxData->Header->SourceAddress) !=3D 0 && > (NTOHL (Mode->SubnetMask.Addr[0]) !=3D 0) && > IP4_NET_EQUAL (NTOHL(Mode->StationIp.Addr[0]), EFI_NTOHL (RxData- > >Header->SourceAddress), NTOHL (Mode->SubnetMask.Addr[0])) && > @@ -214,12 +216,10 @@ IcmpErrorListenHandlerDpc ( > ); > } > CopiedPointer +=3D CopiedLen; > } >=20 > - goto Resume; > - > CleanUp: > gBS->SignalEvent (RxData->RecycleSignal); >=20 > Resume: > Ip4->Receive (Ip4, &(Private->IcmpErrorRcvToken)); > -- > 1.9.5.msysgit.1