From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:400e:c00::235; helo=mail-pf0-x235.google.com; envelope-from=heyi.guo@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pf0-x235.google.com (mail-pf0-x235.google.com [IPv6:2607:f8b0:400e:c00::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A6DD82217CE2A for ; Mon, 11 Dec 2017 02:54:47 -0800 (PST) Received: by mail-pf0-x235.google.com with SMTP id j28so11250622pfk.8 for ; Mon, 11 Dec 2017 02:59:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=vtaGocJTop0hyuLJTqa7CwTz8SRuxtsET1W6Dn6RqvA=; b=jAyiphply3d510Q6E0v0XzCRSsIxqjIqsGyHGDlZV6SXCsgv9iElUUTD7S0rXY3aNG 3MWmcHTOObFWUtsluCZOScthUwQ4QCZcsV/P7/5Q8rddEG0JwwMNyTGJf8fCYrIT/yIS bO344jUtdLXaHZhIQUM0ocH/7+jtYzMRFxeQc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=vtaGocJTop0hyuLJTqa7CwTz8SRuxtsET1W6Dn6RqvA=; b=gLUHYf1/hhzSfOUI0RyXtQV+KGmDlgzX7BrnAE0E858uEHtWOdAcamDVqNuGG0ouZ9 XTSYt/kpj6qraJ+lvvcAx5EvJjKJJ5tgwVra3C8iZE+BlGmrag0iuucIK7w+Zxu0RWTT HshTA9rD8D2iqSqN8NJUn+saPM+4Qd89+0WMjpHI3hZgSYeuXj5XSlZzlk8rPtdjtiVn XGZu971RW3oLdPkMhcco6iF7hpufyfKwSe7PDSJn0ByuegN2P/h2pB3GuOBa4KkCEVb3 KpPRMANtfPTTIcNazRvCm7Ixc+UsqAIQDurABoqTxtDXG0ETRAIfhXwI4n5W+oYfnjBN KSLA== X-Gm-Message-State: AJaThX4Mhw4vXb4HFdtsh+FsYH8v0aIFfiks6HAOgV9hiulKKrMq6eYd XxsnAd2Qjl1+S9O5hXyA5XHDcg== X-Google-Smtp-Source: AGs4zMY/fFbzihmfY7XdTKpg6QDJ+lyjNlHghQYECZXfVub6gz0dnR7KiSoHkH3V1XIXdMLJcfGVDQ== X-Received: by 10.99.96.85 with SMTP id u82mr38367503pgb.247.1512989963922; Mon, 11 Dec 2017 02:59:23 -0800 (PST) Received: from SZX1000114654 ([45.56.152.71]) by smtp.gmail.com with ESMTPSA id d28sm27475980pfb.105.2017.12.11.02.59.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Dec 2017 02:59:23 -0800 (PST) From: Guo Heyi X-Google-Original-From: Guo Heyi Date: Mon, 11 Dec 2017 18:59:18 +0800 To: "Wu, Jiaxin" Cc: jiaxin.wu@intel.com, "linaro-uefi@lists.linaro.org" , "edk2-devel@lists.01.org" , "Fu, Siyuan" , Junbiao Hong , "Zeng, Star" , "Dong, Eric" , "Ni, Ruiyu" Message-ID: <20171211105918.GB67395@SZX1000114654> References: <1512613307-62879-1-git-send-email-heyi.guo@linaro.org> <895558F6EA4E3B41AC93A00D163B727416350E2D@SHSMSX103.ccr.corp.intel.com> <5b9ff1f2-d12b-9f81-555f-97fa2a2ef7b3@linaro.org> <895558F6EA4E3B41AC93A00D163B7274163516AB@SHSMSX103.ccr.corp.intel.com> <20171208020420.GA64189@SZX1000114654> <20171208060005.GA64254@SZX1000114654> MIME-Version: 1.0 In-Reply-To: <20171208060005.GA64254@SZX1000114654> User-Agent: Mutt/1.5.24 (2015-08-30) Subject: Re: [RFC] MdeModulePkg/Ip4Dxe: fix ICMP echo reply memory leak 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: Mon, 11 Dec 2017 10:54:47 -0000 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Hi Jiaxin, Bug 812 has been created: https://bugzilla.tianocore.org/show_bug.cgi?id=812 The regression test has been completed on our platform and I'll post a formal patch in minutes. Regards, Gary (Heyi Guo) On Fri, Dec 08, 2017 at 02:00:05PM +0800, Guo Heyi wrote: > Hi Jiaxin, > > We are still having our QA to finally verify the patches (including the ICMP error listener bug fix), so I will post the formal patch after regression test completes. > > Regards, > > Gary (Heyi Guo) > > > On Fri, Dec 08, 2017 at 10:04:20AM +0800, Guo Heyi wrote: > > On Fri, Dec 08, 2017 at 12:39:30AM +0000, Wu, Jiaxin wrote: > > > Hi Gary, > > > > > > Agree to generate a formal patch. You can attach the reviewed-by tag at the same time. > > > > > > Can you help to file one Bugzilla for this issue? > > > > No Problem. > > > > > > > > BTW, Do you need us commit the patch or by yourself? > > > > Yes, for I can't commit by myself :) > > > > Thanks and regards, > > > > Gary (Heyi Guo) > > > > > > > > Thanks, > > > Jiaxin > > > > > > > -----Original Message----- > > > > From: Heyi Guo [mailto:heyi.guo@linaro.org] > > > > Sent: Thursday, December 7, 2017 8:23 PM > > > > To: Wu, Jiaxin ; linaro-uefi@lists.linaro.org; edk2- > > > > devel@lists.01.org; Fu, Siyuan > > > > Cc: Junbiao Hong ; Zeng, Star > > > > ; Dong, Eric ; Ni, Ruiyu > > > > > > > > Subject: Re: [RFC] MdeModulePkg/Ip4Dxe: fix ICMP echo reply memory leak > > > > > > > > Hi Siyuan and Jiaxin, > > > > > > > > Thanks for your review; shall I generate a formal patch and post it > > > > again, as well as making some commit message refinement? > > > > > > > > Regards, > > > > > > > > > > > > Gary (Heyi Guo) > > > > > > > > > > > > 在 12/7/2017 3:01 PM, Wu, Jiaxin 写道: > > > > > It's is good to me. > > > > > > > > > > Reviewed-by: Jiaxin Wu > > > > > > > > > > Thanks, > > > > > Jiaxin > > > > > > > > > > > > > > >> -----Original Message----- > > > > >> From: Heyi Guo [mailto:heyi.guo@linaro.org] > > > > >> Sent: Thursday, December 7, 2017 10:22 AM > > > > >> To: linaro-uefi@lists.linaro.org; edk2-devel@lists.01.org > > > > >> Cc: Heyi Guo ; Junbiao Hong > > > > >> ; Zeng, Star ; Dong, > > > > Eric > > > > >> ; Ni, Ruiyu ; Fu, Siyuan > > > > >> ; Wu, Jiaxin > > > > >> Subject: [RFC] MdeModulePkg/Ip4Dxe: fix ICMP echo reply memory leak > > > > >> > > > > >> When UEFI receives IPMP echo packets it will enter Ip4IcmpReplyEcho > > > > >> function, and then call Ip4Output. However, if Ip4Output gets some > > > > >> error and exits early, e.g. fails to find the route entry, memory > > > > >> buffer of "Data" gets no chance to be freed and memory leak will be > > > > >> caused. If there is such an attacker in the network, we will see UEFI > > > > >> runs out of memory and system hangs. > > > > >> > > > > >> Network stack code is so complicated that this is just a RFC to fix > > > > >> this issue. Please provide your comments about this. > > > > >> > > > > >> Contributed-under: TianoCore Contribution Agreement 1.1 > > > > >> Signed-off-by: Junbiao Hong > > > > >> Signed-off-by: Heyi Guo > > > > >> Cc: Star Zeng > > > > >> Cc: Eric Dong > > > > >> Cc: Ruiyu Ni > > > > >> Cc: Siyuan Fu > > > > >> Cc: Jiaxin Wu > > > > >> --- > > > > >> MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.c | 3 +++ > > > > >> 1 file changed, 3 insertions(+) > > > > >> > > > > >> diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.c > > > > >> b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.c > > > > >> index b4b0864..ed6bdbe 100644 > > > > >> --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.c > > > > >> +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.c > > > > >> @@ -267,6 +267,9 @@ Ip4IcmpReplyEcho ( > > > > >> Ip4SysPacketSent, > > > > >> NULL > > > > >> ); > > > > >> + if (EFI_ERROR (Status)) { > > > > >> + NetbufFree (Data); > > > > >> + } > > > > >> > > > > >> ON_EXIT: > > > > >> NetbufFree (Packet); > > > > >> -- > > > > >> 2.7.4 > > >