From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.45]) by mx.groups.io with SMTP id smtpd.web10.2773.1689231253860520176 for ; Wed, 12 Jul 2023 23:54:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=selector2 header.b=XcYO3qBd; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: nvidia.com, ip: 40.107.92.45, mailfrom: nicklew@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TTSz/PeagEm6TRnrtK+HFdueuXi8uHwrliH03/D8Wq3/fvBzSPWUXbIn7Vet1Aj4fIDhp/KruG9Xl33yPyIFmVvILmOQgUoeX3iADUQmPCkbEkbIiKjPUbv+N8OZoKVbyNaqWJl9JQlqP+O9BsqQSCibSK2HJA1i0LAW8GWezyRL9NsUlRsUBGVLZfEDrdBr2ZGI/lJtEUH3qKkiUOVq7wlGd2egMnMUM1on0DSGAH2bWUWvRptiHzoiKJMiCDgro9UhGNNRVTL6JsyPuNaAd1HKddCnRZJhmaaa3ej7XW8JvCzG5C8vmp5HoPNXFng0AWlB3RHOqRsjXHAdLQoEwQ== 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=+nFOgVUJcF1IG5OMbY8/DbuW+UD9ubTiFd33lLUXFxg=; b=NXjxH0QtjeYWNC0Sh8NTOa4RkOTy08v1jNKpPCjCniZPgRuM1YhA62PAzlidW0IuG8RhyL+6+a/SWfqzlLrVLvKsZuj1UGpyP8j0sweMA3aigv19iuFGHl6tpuQzgZbAZR0WQGuw+GeNvCx8fry4W2YA8Ea6gqecDxluvHkz+TUJoD+rH2Rlxqpc2SjnFeGWUWDkJU2bP3lWWxNTI2D/jC5p6CX7V8+OkEQ6p+wYuTrMd6O149WTxD1iRWDpArInRiImK+prvsQh9Xu9ZMJyjsKFLGBurrAmgOhsnayrLZR8cagImtd66TjQit/L6qAD93smt99ONn+IQquuhN17dA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+nFOgVUJcF1IG5OMbY8/DbuW+UD9ubTiFd33lLUXFxg=; b=XcYO3qBdVfLXPEwA5jN88717hbQCxwJlcU90Bh02WzGUCYvMrFo4q9qJxX/mIMDnQrRcWAyP3JLO5tOoCYWxBGHgsY8lZhnrpyFY1zjQNlkFNJpLYc9zi8a4cG/iEcagFK33uTPUJAQ3eeBhedDVK9jUnoQBwlsrVVLHDVg3SPslDLDV6HNP75sNHj3gUAxd9d/K25lS69Y7VA0QKt7ujXSmLskRQ/OisnNbH6kWoQ39nSjB1caj4scRXt4sT21f0qVj4P5R4lXyZ9zO3jl7EISTS3qvyXxqEWiX3a1aW79jkFHG0JB0p6mgE/EbgrE7ED4aWUd9yOklRz7dYmp02A== Received: from MW4PR12MB7031.namprd12.prod.outlook.com (2603:10b6:303:1ef::6) by SJ2PR12MB8719.namprd12.prod.outlook.com (2603:10b6:a03:543::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.31; Thu, 13 Jul 2023 06:54:08 +0000 Received: from MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::820f:3158:c86f:9bca]) by MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::820f:3158:c86f:9bca%7]) with mapi id 15.20.6588.017; Thu, 13 Jul 2023 06:54:08 +0000 From: "Nickle Wang" To: "devel@edk2.groups.io" , "saloni.kasbekar@intel.com" , "zachary.clark-williams@intel.com" CC: 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+gO4QQgAEvnACAADfV0IABlBQQgBT7atA= Date: Thu, 13 Jul 2023 06:54:08 +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=nvidia.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW4PR12MB7031:EE_|SJ2PR12MB8719:EE_ x-ms-office365-filtering-correlation-id: c778e551-8641-45f5-bfe3-08db836df4c7 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: K6ZODsOvp8kq2210eYtCutfma18GY6+mHkb8Gspy3lhWHqpySuyntSHN/0pCjmpvp9KiPWhhXFg9DWA22gCc8T7JuK4hQUX8lcvKkO7UcQ1qu8Kw4KR9xZjLTfvhjRYlwhnDjfPGMnz2TV2lDivhsDc9bSXhOlTsoY/ZAxfM1SaBz+TYmtoJxWYBw2+Xme6G+jwTL7qVgA0SASen8SB4ct055rDdcWqgvmtUlne39dYvGuJDGHkDeseVHKDEj5/qVDhkhBiozc7ICoIRsBWmJyZmyJYl5Q8bvSfc3xgEO7FUX1IbRGZeMzrHorSgoO0JToWk7XRO/+eU03zFeO0f6hlFumkQhlwTqo2WcHGu2ro9p6WVUgpq+82T1EJ1vZYUg6304DFWLP/6yphYZhDw80HzvJUvAmvZdBP32s7wDVDidHgYhwAOAl79YQElnER/Wfq+4czUhfKX5HqgWS6ZHeRx8U017KhKHwuDmCWR1Cou3KTHo5MsKuT8mx9AeJK1Q+PF0jpg07759tRL4Z3a4cK/utsSNFQDIVqEeNfsvS0/fqchvluhl1c58ei6+fdcJjYcQ5ulTTDCO2ICcz52CTKcjZu3OzHn+XQ2jO08Eqed6OPdze6RK//hOjyujQFJ x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR12MB7031.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(39860400002)(376002)(366004)(396003)(451199021)(86362001)(107886003)(52536014)(38070700005)(8936002)(5660300002)(8676002)(41300700001)(316002)(66946007)(2906002)(4326008)(66446008)(64756008)(38100700002)(76116006)(66556008)(122000001)(66476007)(66899021)(54906003)(110136005)(33656002)(71200400001)(83380400001)(478600001)(7696005)(9686003)(6506007)(186003)(966005)(53546011)(55016003)(44824005);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ME5YgrwQVqavs1o/x38UP2lRrEENxkqvgPIeV3i1zqrNa3OmIZB2vsCbMwx7?= =?us-ascii?Q?lruCdbsaIeHi2S2Vg8Ps1o5XR6VH9qrAlp5G4gs5LhF6zhczfJkFvUllOrDW?= =?us-ascii?Q?Me1KLclOcuZwIaJs6s5ogVR7q320syRFlYSoAjcH9SyYTCZvhj4X3yvJro5C?= =?us-ascii?Q?8PYLSi9PGm56t6ztJFNLs+kHvPUpGgD6qjvYUk9z6uBo+QdyHf1WRwhToJS8?= =?us-ascii?Q?N8gQS8dtQkIcPIRPaSWuOYP/q5a7ymEAlSN66hEs08trw/n8WClFqzb3VdY3?= =?us-ascii?Q?LTd+gojOLL8Oa8EZlnAnlKnhx0OAQxrvsYL9/wiDcrV4Z16fR6cSXfzoYhKG?= =?us-ascii?Q?2al0B92W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YyquK+t?= =?us-ascii?Q?EESTMaQORtIMtxVFV4Yzv/RHSmGm5wFmsu7VGPlx+O1MOCd0LIMiquXKnTyq?= =?us-ascii?Q?6NDBjKY0YEREgfz53JJDDFe7/UkgP9vqDG9rDaZ0Dbpy4XsffVEN8w4MdoUs?= =?us-ascii?Q?xjShFfIOHnQnooqCHMW9QiTSIivkSOZRIZX9u4FX2Xl6wavpUD/7XstkFDT+?= =?us-ascii?Q?pX1sVWvsR5OhzUeg1iKQUWTyeU5sGJtUEZbnXWNaFnEzJtyKlniYzKkbGrUQ?= =?us-ascii?Q?EE+RNU+IiN02q4VTuEQsSVkQcJBBdxCzJtjRz3tREG0SzihJ59p4H3yrn1IZ?= =?us-ascii?Q?sMHEbMGLThpT7rC6HFjQW+WHGzU22/oyRWsN6wPsRjVk9qJRK6H4B+FMx03O?= =?us-ascii?Q?+dPSIXhE+fxe3FNyXepNy1hr8jozKB6zizpO+ZkRgDkB?= MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR12MB7031.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c778e551-8641-45f5-bfe3-08db836df4c7 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jul 2023 06:54:08.4223 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 1RiWDPhpy1pRiwuONuXaPPuhi1XcdjPTDXJO5eim7mqzdqxt7P2RTUehUHi717eYvBaY6uoUDKcMIyQlnu0brQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8719 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Saloni, Could you please help to merge this fix since there is no objection during = past weeks? Thanks, Nickle > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Saloni > Kasbekar via groups.io > Sent: Friday, June 30, 2023 6:28 AM > To: Nickle Wang ; devel@edk2.groups.io > Cc: Maciej Rabeda ; Siyuan Fu > ; Abner Chang ; Igor Kulchytsky= y > ; Nick Ramirez > Subject: Re: [edk2-devel] [PATCH 2/2] NetworkPkg/HttpDxe: fix driver bind= ing > start issue. >=20 > External email: Use caution opening links or attachments >=20 >=20 > Hi Nickle, >=20 > That makes sense. Thanks for the clarification. >=20 > Reviewed-by: Saloni Kasbekar >=20 > Thanks, > Saloni >=20 > -----Original Message----- > From: Nickle Wang > Sent: Wednesday, June 28, 2023 3:30 PM > To: Kasbekar, Saloni ; devel@edk2.groups.io > Cc: Maciej Rabeda ; Siyuan Fu > ; Abner Chang ; Igor Kulchytsky= y > ; Nick Ramirez > Subject: RE: [edk2-devel] [PATCH 2/2] NetworkPkg/HttpDxe: fix driver bind= ing > start issue. >=20 > Hi Saloni, >=20 > Thanks for your review. >=20 > When uninstall fails, per UEFI specification, the protocol will be instal= led again > and will be visible to UEFI drivers. >=20 > Page 190, UEFI spec. 2.10: > "If any errors are generated while the > protocol interfaces are being uninstalled, then the protocols uninstalled= prior to > the error will be reinstalled with the boot service > EFI_BOOT_SERVICES.InstallProtocolInterface() and the status code > EFI_INVALID_PARAMETER is returned." >=20 > In this case, if we do FreePool while driver still can locate > gEfiHttpServiceBindingProtocolGuid. Driver will access to the memory that= is > released to system. Memory issue may happen. >=20 > Regards, > Nickle >=20 > > -----Original Message----- > > From: Kasbekar, Saloni > > Sent: Thursday, June 29, 2023 3:07 AM > > 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 > > binding start issue. > > > > External email: Use caution opening links or attachments > > > > > > Hi Nickle, > > > > We would want to do the FreePool even if the Uninstall fails (like in > > the case where we failed to install the multiple protocol interfaces > > and then went to ON_ERROR). Do you think it's better if we change it > > to - > > > > if (HttpService !=3D NULL) { > > HttpCleanService (HttpService, UsingIpv6); > > Status =3D gBS->UninstallMultipleProtocolInterfaces ( > > &ControllerHandle, > > &gEfiHttpServiceBindingProtocolGuid, > > &HttpService->ServiceBinding, > > NULL > > ); > > if ((HttpService->Tcp4ChildHandle =3D=3D NULL) && > > (HttpService->Tcp6ChildHandle =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 > > binding 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 Wang via groups.io > > > Sent: Friday, February 10, 2023 8:34 PM > > > To: devel@edk2.groups.io > > > Cc: Maciej Rabeda ; Siyuan Fu > > > ; Abner Chang ; Igor > > > Kulchytskyy ; Nick Ramirez > > > Subject: [edk2-devel] [PATCH 2/2] NetworkPkg/HttpDxe: fix driver > > > binding start issue. > > > > > > External email: Use caution opening links or attachments > > > > > > > > > When failure happens in HttpDxeStart, the error handling code > > > release the memory buffer but it does not uninstall HTTP service > > > bindnig protocol. As the result, application can still locate this > > > protocol and invoke service binding fucntions in released memory pool= . > > > > > > 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(-) > > > > > > diff --git a/NetworkPkg/HttpDxe/HttpDriver.c > > > b/NetworkPkg/HttpDxe/HttpDriver.c index 5d918d3c4d..f6d1263cad > > > 100644 > > > --- a/NetworkPkg/HttpDxe/HttpDriver.c > > > +++ b/NetworkPkg/HttpDxe/HttpDriver.c > > > @@ -3,6 +3,7 @@ > > > > > > 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 > reserved. > > > > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > > > @@ -464,8 +465,16 @@ ON_ERROR: > > > > > > 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); > > > + } > > > } > > > } > > > > > > -- > > > 2.39.1.windows.1 > > > > > > > > > > > > > > > > > > > > > > > > > >=20 >=20 >=20 >=20 >=20