From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (NAM11-BN8-obe.outbound.protection.outlook.com [40.107.236.41]) by mx.groups.io with SMTP id smtpd.web11.13217.1676032459105487098 for ; Fri, 10 Feb 2023 04:34:19 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@nvidia.com header.s=selector2 header.b=lnAHj5gJ; 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.236.41, mailfrom: nicklew@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mQY8I/rbTKdLlpZzIbTq9JK4Ntk6pigG+zpZY/lBAdF/9u2ODdCqwFAbBhFK9l9gRHkXDE5w6ZRd540geKSq8zjE6PNf6VF8r0WhRPN1rNWRxUN1yWb7zlz9BARyWaWC+MzVQmtyeB407vcToNhVj3rtzKAXjhrYn4HhWy6cMcZwAhvMgt0lbUWx2XWfkApf/15RaMoppGFNfcTzE6cSqcT4tgy+mo8U2ztcsNMaftzhSj66A8Q8I1P4HyggvRhFqpu2RXZ2bs44Fv/HvXNER/4tmOyEzjKcCBDE7KJsrcVe+Gw/PtrnO7KEai7Mvwop8hIsVkOeXO7e/pjld0ueeQ== 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=TKE7+PtWseljOoN2B+As3Z2FW1ly4rwrkqYoInhjk6I=; b=kK5LZ+CcY9ZIGP0byIcNyIXl+/lvm/vXSac4iHHI2qx1k5vLbX1A1q1GadahPhTx//NjBuKb6Qobxz5fxzGcRXrPnsIZ3n6r+etLuGfF0IJNl+o+ckLRrqzliPbL2upTJczSSh9WFAhxgDnEMn/jgU06Y6mNhbIKyofFDP0LfPWDQFvNffcpzyaPu8iy2iwDG+sxay6xf9vdLT/B5HnmJcDagjI7aweJ2M3vCuteW5SH7q3xvQg5EFk445v5bHu68fAqN6WpWdXX2qEWi221bjsqY1oKB1sMvf0ifW3WpxDA3KgoeZdvnBRnrO4xhaJGPP3xbL3bxO//b3rQ17urQg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=TKE7+PtWseljOoN2B+As3Z2FW1ly4rwrkqYoInhjk6I=; b=lnAHj5gJksh4r1vaHZItRMw6HfgxFLhMirSEnRqlCA2x6boFd3TGexl5eJxrtW3qGNlafMrfX+p4NGAf0Td3VVJf2xSBHO1a658M3las7HZMAVPh5p8xdpkOc/ECmfNcAeKNA0ymnc1PWgZkKVb0xILDlukXYp4q+/N4sLFvs9hZAUL4tgXNJzm/V0SR1dQRoPxdU4qGAJvoBFRJW3zUFkSwSidCUUrg153QGymTtFeK3Foah9lBFD0vm3tdfWRWoPOFIHhpwSEhdbfOQiziSmMnhtlRKb3ekPjHbydbV4lxNPJNFCLgq+JFfUllsXLLVAWc/9VYsrLm0mBPy+H6DA== Received: from DM6PR03CA0037.namprd03.prod.outlook.com (2603:10b6:5:100::14) by SJ0PR12MB7082.namprd12.prod.outlook.com (2603:10b6:a03:4ae::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.17; Fri, 10 Feb 2023 12:34:16 +0000 Received: from DM6NAM11FT101.eop-nam11.prod.protection.outlook.com (2603:10b6:5:100:cafe::dd) by DM6PR03CA0037.outlook.office365.com (2603:10b6:5:100::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.21 via Frontend Transport; Fri, 10 Feb 2023 12:34:15 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by DM6NAM11FT101.mail.protection.outlook.com (10.13.172.208) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.21 via Frontend Transport; Fri, 10 Feb 2023 12:34:15 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Fri, 10 Feb 2023 04:34:04 -0800 Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Fri, 10 Feb 2023 04:34:04 -0800 Received: from NV-CL38DL3.nvidia.com (10.127.8.12) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.986.36 via Frontend Transport; Fri, 10 Feb 2023 04:34:03 -0800 From: "Nickle Wang" To: CC: Maciej Rabeda , Siyuan Fu , Abner Chang , Igor Kulchytskyy , Nick Ramirez Subject: [PATCH 2/2] NetworkPkg/HttpDxe: fix driver binding start issue. Date: Fri, 10 Feb 2023 20:34:03 +0800 Message-ID: <20230210123403.193-1-nicklew@nvidia.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Return-Path: nicklew@nvidia.com X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT101:EE_|SJ0PR12MB7082:EE_ X-MS-Office365-Filtering-Correlation-Id: d6de39be-31f5-43a1-7002-08db0b631f62 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9w/BQfIeeBnvgWmvk4hkEghf6rij+0zHwWkv4upfDRoS/dU2mLoCsug2n8gCi9SFfinHbtGBk2rvy1qkbaD1GrxYVB5itMUC9AOJkapj0049vMQmS77iTvvBlDPXCcB3rXnU9t1/UWJ7iyHZA6YDexUAtpUG9dKw1PlVDD09NCNBdA6xGjCnqu1uP+CdKQcc+riR7/dHT5H4aSDcnsWZ0mWBdOngToPz3fDXSxzJNonmk9N/BIh5VbnSFawo1elW0mLk4Hl7Zx0FrlUh6zGGgIRosFK+nrAn9iTsd130lcOOPwZAR5oCVUQQ/5NyIvTv+Ntmghg7DJLqcq0kL99vyh75GfYteU1MYKCVyV3GS+4IPRUUi4A3ZCMLszGd9B3qD+9kvGHcbqB66sLkhufozVyeLSkz/uxZvQljaFyVuFGCY4ed6XsgRWzDgMyAJg0hu9FsxDdWarOWdtPi4/D2fdY2zUV1HmvZapeuG//1+80+AAJWGWjb0/LqXcqohYXAMY6xqq9Al+SzeBc1PuUMOFr3KvavJEQmT9ZbsWgGx7wLQoiW5Ux7pc2v8yaOj0ZNHQBOAbAomPAPtspHKkjk+vn5ittVo1KzeydAU6tOBNhcY3EjzqKumnBpeTj9erlcgbebTDfsjv8DW/mmf4FXYIKyz/Yb253lYq628REc5UgOsrgu//OWRF31t0GloF65WMKSebKPXn7xYpYxKhe1S3jP8XYZKQi/sLv7lEUjZJE= X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230025)(4636009)(396003)(136003)(376002)(39860400002)(346002)(451199018)(36840700001)(40470700004)(46966006)(47076005)(83380400001)(426003)(336012)(2616005)(478600001)(82310400005)(54906003)(316002)(40480700001)(70206006)(2906002)(356005)(70586007)(36860700001)(36756003)(8936002)(8676002)(4326008)(7696005)(41300700001)(1076003)(6916009)(5660300002)(86362001)(40460700003)(26005)(107886003)(7636003)(186003)(82740400003)(44824005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2023 12:34:15.7863 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d6de39be-31f5-43a1-7002-08db0b631f62 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT101.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB7082 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain 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/HttpDrive= r.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 reserved= . =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->Tcp6Ch= ildHandle =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->Tcp6= ChildHandle =3D=3D NULL)) { + FreePool (HttpService); + } } } =20 --=20 2.39.1.windows.1