From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web11.2553.1687979213291781833 for ; Wed, 28 Jun 2023 12:06:53 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=UZQiXQxH; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: saloni.kasbekar@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1687979213; x=1719515213; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=pmV302InUT8zbW2NniqBvfWYlfylnkWuU6hgry9wMoE=; b=UZQiXQxHyFwWC/Z/9D+77VwGmylAHQgNbVO9ZsIZMiOi0HfQSTaWzck7 xCXG+5x2y5FgZJlJjFIkzciumNq7275PLVNKl+Oz+G+9SVw3WuIgywwUT gfWGjXyfPqj8s0ZkH3EVZn04jWGXXHq6RuSsbZtJZ3MpeB3PXb20xdkMn Izape0O+gTZx76lm/vmyqqMxNfl2jrV9ssJC7rWlpN8pglgoedzE5uMnU 4J69aKUZgsHlo6ZnG5r9aXM8EaX3XekBpk68omK+hMrvM4Ua2a/OYDOm8 MeBgBcnQOX4TcIGpoEBCohvKcFvcG7MK+GmDQGEX41aNcMc1iWZvgnDxs w==; X-IronPort-AV: E=McAfee;i="6600,9927,10755"; a="364486060" X-IronPort-AV: E=Sophos;i="6.01,166,1684825200"; d="scan'208";a="364486060" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2023 12:06:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10755"; a="782408405" X-IronPort-AV: E=Sophos;i="6.01,166,1684825200"; d="scan'208";a="782408405" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga008.fm.intel.com with ESMTP; 28 Jun 2023 12:06:51 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 28 Jun 2023 12:06:51 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 28 Jun 2023 12:06:50 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend Transport; Wed, 28 Jun 2023 12:06:50 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.49) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Wed, 28 Jun 2023 12:06:50 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AN3laNsndLjVhmMf1wmWeTme6iEkUKTB1tlaoU8gmXwsz4cj7SvOcBVObDs2o0OLoUl/k+VzLHtlWCwRe392Sk1C7do2gbmPaZKt7f+UgaNl468dzlM/Vmiq2ljQlLtRGErOOylwh6krEpwOjZ2hxFELNGa4eTYxPeqCQV714MhtJqNXk4JMXOkSuI4UaLrDeFvTJWajo38j4FCEHJStt2tfOLiPVDW4hlFqk8xXg49m66YPrI01/Z9uFOowDd3tVZ7+4VWs6djkMBQeprUhYkGrYV7mHe4zjdIa995xIswbFTvs8drtkhNyT2+edm5nDAbfHo2jLusbHMM9xNJWcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=x/hTGQEOiTlzEbIhcaImpHS2HTOpCvnv7NhmvKKW+SA=; b=hx+lwZLhD2AOPjetE43yRts2aC2hQ9zc9vkwE+tp4lR+TD7x38G35IHZrnhLZb1h8M4gapYAHunN+LcGqSVO4b4OtGihuL520Bw+FaeP+QXFVFBV2CvrOTPs9g2JKSqRYks8VOsopinoUbEUQpsv8jDfVwpvw35XFQYpD4TnlW01RsKd3jD+/5jMB+i3/VrmKkpoNul8jzVGz/S6JAPhCEyhfwb0KTsrvhT6HzXFuXuyAwwoPNiicLivicbJyJOhnJCvVGPzHyVYnhZoU9+tRFLjiAOh2Xjw1uB0HZbWZoqEImCIhMZss0NHHm/FkiEriFZ7gh6lW7qIDzjX4E9OLg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from BY5PR11MB3861.namprd11.prod.outlook.com (2603:10b6:a03:18d::13) by CO1PR11MB5044.namprd11.prod.outlook.com (2603:10b6:303:92::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.21; Wed, 28 Jun 2023 19:06:49 +0000 Received: from BY5PR11MB3861.namprd11.prod.outlook.com ([fe80::5891:74e:1fc9:ba76]) by BY5PR11MB3861.namprd11.prod.outlook.com ([fe80::5891:74e:1fc9:ba76%2]) with mapi id 15.20.6544.012; Wed, 28 Jun 2023 19:06:49 +0000 From: "Saloni Kasbekar" To: "devel@edk2.groups.io" , "nicklew@nvidia.com" CC: Maciej Rabeda , Siyuan Fu , Abner Chang , Igor Kulchytskyy , Nick Ramirez Subject: Re: [edk2-devel] [PATCH 2/2] NetworkPkg/HttpDxe: fix driver binding start issue. Thread-Topic: [edk2-devel] [PATCH 2/2] NetworkPkg/HttpDxe: fix driver binding start issue. Thread-Index: AQHZPUwAuV9WkswkYkek1DFyHKnaxa+gO4QQgAEvnAA= Date: Wed, 28 Jun 2023 19:06:48 +0000 Message-ID: References: <174276A45CE2816B.5513@groups.io> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BY5PR11MB3861:EE_|CO1PR11MB5044:EE_ x-ms-office365-filtering-correlation-id: 69b89533-d5f1-4f39-00c2-08db780ad2eb x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Xj/0rU+DJvLn4fgL0wvNGVWA23XrjA+Oj0em4I43vmN1cnBpaJQESQcrzagwMmJumGWmqRIbgWzIEyg/gdA9Zy304vsWSA/UAsKe5GYJfZpoKdlvugq1jUG0y32LeKq9NPa3W6gq+2FoYkOEaSHArhwkfjK9LoZhrPtfnhPtJgBv8m7D00DK761ssniR6Anj5zfuTOIKA0pakY2d6ZWmYoBQFX3ppyO1N9o1DpZ5bhZ7Jm7qgeyHaCty9i+WJjAuPJDlk3CONeA/qImDbpHrulMbZNXCAJRLtXfKaBR35dYkuiFvMH60fW2mj1V/r2v32Yo0dBaa2dYLGr0D2q4lKc9aE7tODywv//AWglJraO8XkYO2r0Vxe4m54ii0pc1UManweC8nzIlq3R+GpbzaaGgKPXt9dcSeZnEQeDCPlpmNW3xnjAGaRF3yPAYdAWCR33a3FyMUKe7xuQFMr3yOwVZfbMLrkRbyeAcPY01bHXyhJygwToHAfGjKXA4AzllGPXqqM0IMYqTsAJQmoyP/KmaX1LuS4Q8MeO7/cj/H/+hu7SlzPf1YV3IAJdVsXwLFO8JUYlklj7QR+bLlVua0O3Aj4zCR2veV4vtsW9R5LshR796/bA/3anDCl+SQKHdBEQdiOHZZS0PmC5UqdFtLLc71y8HP8BDiOSayWJT/hUM= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR11MB3861.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(376002)(39860400002)(396003)(136003)(366004)(451199021)(53546011)(66446008)(966005)(7696005)(54906003)(110136005)(71200400001)(83380400001)(26005)(9686003)(2906002)(478600001)(6506007)(186003)(5660300002)(64756008)(33656002)(52536014)(38070700005)(76116006)(82960400001)(4326008)(316002)(55016003)(66946007)(38100700002)(8936002)(66556008)(8676002)(86362001)(66476007)(122000001)(41300700001)(66899021)(44824005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?njRrflE/ersIVPG18bPZ506NXUksPVk6ZOO5L+QmC6xfGTlomiijgZ9gV2dd?= =?us-ascii?Q?B8LEtdBpP3+/jfXm6iWHz+w+FuwzhBaUmHX1N3gTtzACBkDS5lCRGv6jZ5Q/?= =?us-ascii?Q?p0+VCAyBV2y/hRf3/nK1mSszVlCKgM3/BOGorT9MkgOAq666ddsb5ZL3exWc?= =?us-ascii?Q?rsoxIX+MfttSl0Ouz7yNZM/c6lfhAdG9fCoozepImzMvANqtjHMBW45/hBeY?= =?us-ascii?Q?zslnQeRrsMDrH5HbxY2hsajDqmL2N2EnSCePROJ4eSx4IAIUXEo/f9MxRNO9?= =?us-ascii?Q?qS4vJTonk8tofYA5vz1sNcNpBEvnimN3zC0Ce6bZn1IYivTxLQzINgOGN19C?= =?us-ascii?Q?I3IRNvgB2MKa4efUP6MKAqe+anyKV862wfg7yD49z0/U/WKkvQR8DQpgR8Kg?= =?us-ascii?Q?9JYUPkwyuUUcde2PoEGMKaMoCAMaTe9dCf+b3P78mCjbL0qbjNr5aL8H8/KU?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xXcl034Nblshu+d2fr0OjuzHJ4Z?= =?us-ascii?Q?0eVABxZUKNdshfR/qr8Mmjgrsj11mX6udsZjt+9mco2riU25msPEJA/DTxT+?= =?us-ascii?Q?Wz4V8M9MZ4oPEh8mxEVZJqiWmhvM/kVE3VHLz7b1kIYlFxbsuHKJpb7Gr67X?= =?us-ascii?Q?FQSYC/zFujxhNns3sYMsyNMUAtHkJH0dOi5AZCnX2C6DeEB9rcqQvH8oRjB6?= =?us-ascii?Q?geV5n2F/OwzamLa9AkDi3BeKVq6PAd8/vNaQdJ7k?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BY5PR11MB3861.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 69b89533-d5f1-4f39-00c2-08db780ad2eb X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Jun 2023 19:06:48.6610 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Z5i9vHKQQa2KlDRoPZujchqz4E/UYgfI6TlOOSyFr3dCnPJ9nHvekxAbfxWAxZinBNYv7CJl26JjSVhI3Us3W05jGhkuvSZLaY3ZBaOG1xE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB5044 Return-Path: saloni.kasbekar@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Nickle, We would want to do the FreePool even if the Uninstall fails (like in the c= ase where we failed to install the multiple protocol interfaces and then we= nt to ON_ERROR). Do you think it's better if we change it to -=20 if (HttpService !=3D NULL) { HttpCleanService (HttpService, UsingIpv6); Status =3D gBS->UninstallMultipleProtocolInterfaces ( &ControllerHandle, &gEfiHttpServiceBindingProtocolGuid, &HttpService->ServiceBinding, NULL ); if ((HttpService->Tcp4ChildHandle =3D=3D NULL) && (HttpService->Tcp6Chi= ldHandle =3D=3D NULL)) { FreePool (HttpService); } } Thanks, Saloni -----Original Message----- From: devel@edk2.groups.io On Behalf Of Nickle Wang = via groups.io Sent: Tuesday, June 27, 2023 5:56 PM To: devel@edk2.groups.io; Nickle Wang Cc: Maciej Rabeda ; Siyuan Fu ; Abner Chang ; Igor Kulchytskyy ; Nick Ramirez Subject: Re: [edk2-devel] [PATCH 2/2] NetworkPkg/HttpDxe: fix driver bindin= g start issue. May I know if someone can help to review this patch? Thanks, Nickle > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Nickle=20 > Wang via groups.io > Sent: Friday, February 10, 2023 8:34 PM > To: devel@edk2.groups.io > Cc: Maciej Rabeda ; Siyuan Fu=20 > ; Abner Chang ; Igor=20 > Kulchytskyy ; Nick Ramirez > Subject: [edk2-devel] [PATCH 2/2] NetworkPkg/HttpDxe: fix driver=20 > binding start issue. >=20 > External email: Use caution opening links or attachments >=20 >=20 > When failure happens in HttpDxeStart, the error handling code release=20 > the memory buffer but it does not uninstall HTTP service bindnig=20 > protocol. As the result, application can still locate this protocol=20 > and invoke service binding fucntions in released memory pool. >=20 > Signed-off-by: Nickle Wang > Cc: Maciej Rabeda > Cc: Siyuan Fu > Cc: Abner Chang > Cc: Igor Kulchytskyy > Cc: Nick Ramirez > --- > NetworkPkg/HttpDxe/HttpDriver.c | 13 +++++++++++-- > 1 file changed, 11 insertions(+), 2 deletions(-) >=20 > diff --git a/NetworkPkg/HttpDxe/HttpDriver.c=20 > b/NetworkPkg/HttpDxe/HttpDriver.c index 5d918d3c4d..f6d1263cad 100644 > --- a/NetworkPkg/HttpDxe/HttpDriver.c > +++ b/NetworkPkg/HttpDxe/HttpDriver.c > @@ -3,6 +3,7 @@ >=20 > Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
> (C) Copyright 2016 Hewlett Packard Enterprise Development LP
> + Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserv= ed. >=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > @@ -464,8 +465,16 @@ ON_ERROR: >=20 > if (HttpService !=3D NULL) { > HttpCleanService (HttpService, UsingIpv6); > - if ((HttpService->Tcp4ChildHandle =3D=3D NULL) && (HttpService- > >Tcp6ChildHandle =3D=3D NULL)) { > - FreePool (HttpService); > + Status =3D gBS->UninstallMultipleProtocolInterfaces ( > + &ControllerHandle, > + &gEfiHttpServiceBindingProtocolGuid, > + &HttpService->ServiceBinding, > + NULL > + ); > + if (!EFI_ERROR (Status)) { > + if ((HttpService->Tcp4ChildHandle =3D=3D NULL) && (HttpService- > >Tcp6ChildHandle =3D=3D NULL)) { > + FreePool (HttpService); > + } > } > } >=20 > -- > 2.39.1.windows.1 >=20 >=20 >=20 >=20 >=20