From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by ml01.01.org (Postfix) with ESMTP id 4192B1A1E0B for ; Tue, 16 Aug 2016 00:57:22 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP; 16 Aug 2016 00:57:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,529,1464678000"; d="scan'208";a="156405019" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga004.fm.intel.com with ESMTP; 16 Aug 2016 00:57:20 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 16 Aug 2016 00:57:20 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.181]) by shsmsx102.ccr.corp.intel.com ([169.254.2.147]) with mapi id 14.03.0248.002; Tue, 16 Aug 2016 15:57:18 +0800 From: "Ye, Ting" To: "Wu, Jiaxin" , "edk2-devel@lists.01.org" CC: "Fu, Siyuan" , Cohen Eugene Thread-Topic: [edk2] [Patch] MdeModulePkg: Fix potential failure if UseDefaultAddress configured Thread-Index: AQHR9p9QPaoSmLzhV0WXXFqjK6enqqBLOj1w Date: Tue, 16 Aug 2016 07:57:18 +0000 Message-ID: References: <1471229217-7004-1-git-send-email-jiaxin.wu@intel.com> In-Reply-To: <1471229217-7004-1-git-send-email-jiaxin.wu@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] MdeModulePkg: Fix potential failure if UseDefaultAddress configured X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Aug 2016 07:57:22 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Looks good to me. Reviewed-by: Ye Ting =20 -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Jiax= in Wu Sent: Monday, August 15, 2016 10:47 AM To: edk2-devel@lists.01.org Cc: Ye, Ting ; Fu, Siyuan ; Cohen E= ugene Subject: [edk2] [Patch] MdeModulePkg: Fix potential failure if UseDefaultAd= dress configured IpSb->Reconfig should not be set to TRUE to focal the reconfiguration during the policy changes from Static to DHCP. It's redundancy because the = default router table and default addresses have been freed ahead ( Detailed= see Ip4Config2OnPolicyChanged() function). Otherwise, the potential failur= e will appear if UseDefaultAddress configured. Reproduce steps see below: #1. Set policy to DHCP. #2. If DHCP process is not complete yet, then run one APP to invoke UDP4 Co= nfigure with "UseDefaultAddress =3D TRUE" (loop to call UDP4 Configure unti= l Ip4Mode.IsConfigured changes to TRUE). #3. Even DHCP succeed but Ip4Mode.IsConfigured flag never set to TRUE Concrete analysis is as follows: In #1, the policy will be set to DHCP, and then Ip4Config2OnPolicyChanged()= will be called. In this function, if "IpSb->Reconfig" flag is set to TRUE,= the original "IpSb->DefaultInterface" will be abandoned/freed once the DHC= P process finished. In #2, UDP4 Configure with "UseDefaultAddress =3D TRUE" is called, that mea= ns the default interface (IpSb->DefaultInterface) will be selected as curre= nt instance's interface. In #3, when DHCP process finished, the original DefaultInterface will be ab= andoned/freed because "IpSb->Reconfig" flag is true. Meanwhile, one new int= erface is assigned to "IpSb->DefaultInterface". This new interface is diffe= rent to the original one assigned to the UDP4 Configured instance. So, even= DHCP process succeed, the up caller will never have the chance to get it's= truly status. Cc: Cohen Eugene Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu --- MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c | 1 - 1 file changed, 1 deletion(-) diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c b/MdeMo= dulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c index f91a935..75ad301 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c @@ -148,11 +148,10 @@ Ip4Config2OnPolicyChanged ( =20 // // Start the dhcp configuration. // if (NewPolicy =3D=3D Ip4Config2PolicyDhcp) { - IpSb->Reconfig =3D TRUE; Ip4StartAutoConfig (&IpSb->Ip4Config2Instance); } =20 } =20 -- 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel