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.64]) by mx.groups.io with SMTP id smtpd.web10.4789.1681463033729407038 for ; Fri, 14 Apr 2023 02:03:54 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=selector2 header.b=JFKmuTOR; 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.64, mailfrom: nicklew@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DXOkvoeXouK82MWBpSlsap/puW3h3yQ3t150LbMf+szMkVCZ0u+TtcZ9XWHwE7lkcLPOMnkjVBtsVSpl9H35ykgnyPaOSoQMDHvQaOG38kjHmFXz/jFlVdOPxQIvXf8mnEUnQZhQHvW2SKf/0A2M7EfrHEHEj7fIswRo/AK8ahwvg5YeXv9zrSfQK+2UBj20mhR7cLRUrf2ywYsN3c0hDzHp5xNNuQXw5ElFtyXyQxobAIiQM5cqHgqRY21B/p6bUU5m1hn4pfJ72hTIYG7c13YsYk7+SZbZHr0/Jzqv+qHh355E3lNDEBUdx6HuqivnPJZK1QnziiMKWsUhTUpy2w== 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=ih6kO2fINWAfqoVxZ9yp8xFFEjAnqMkLD9CO1Wm5tRc=; b=DnRrfSGrTVLKlvhyiwp/FcUdy8WYOu2bahs4tQFkpcKX1R7een2LLHjsSLtQRtJgiU4jRuEgCSUMCFmUILz7L9kZEG03juKto6M1GtULwae6b0IfbDDI6b09kOKs+iiY6BKLJU0vlz6Lk+zz4HvYAQFgA7HchKBp+asZyDkyGwu/KtLUSVoepTYbl24cYUVaoiWEr/I1cm3YDR5IYyQEKpEBFbb3OKHeP0uwYzM8E2gzTQAU4QQcchM+F55vadLrf9bxe5t0dx5H1aCNObDinpSmG9GczxLQSS/YkBxjb3YYM040x1EO2afoMbvgpbT7eus+9slTKMsvibBqxQ88cw== 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=ih6kO2fINWAfqoVxZ9yp8xFFEjAnqMkLD9CO1Wm5tRc=; b=JFKmuTORZcLUxwLWrl4JQ/ZcPgg26KxE+yQd7synCZp8jvGES59YaktgBX9EHjeV75dnUJ0aOO3ObdMnVlW99bnCxmM/RbAtTOEuGHSUOLx2K2We2d8M2YDZ+azFzrFUyT3nCtmZf0R6wwL0SxFUvXBL0j5VBO9xA7SjU8biCbnXvfWByJ644FO+r8ESGsmeAgrwfjcPjgiicYHlCgPGBHfJjE+NuzM9WvGQwee8DExJIF4+b+cN6udT6c8fp+sYr7Z2W6dIl0Jj2F/G3cg9/7xN803xPXaNkOI6hhgHca3PE5p4/AgqBRfL6BOFcRgG7GJi79WFLW3yE4UdtuNUjg== Received: from MW4PR12MB7031.namprd12.prod.outlook.com (2603:10b6:303:1ef::6) 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.6298.30; Fri, 14 Apr 2023 09:03:51 +0000 Received: from MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::deb:4184:674f:c674]) by MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::deb:4184:674f:c674%4]) with mapi id 15.20.6277.038; Fri, 14 Apr 2023 09:03:51 +0000 From: "Nickle Wang" To: Minh Nguyen , "devel@edk2.groups.io" CC: "patches@amperecomputing.com" , "abner.chang@amd.com" , "igork@ami.com" , "nhi@os.amperecomputing.com" , "tinhnguyen@os.amperecomputing.com" , Vu Nguyen Subject: Re: [PATCH 2/5] RedfishPkg: Prevent assertion of allocate zero length region Thread-Topic: [PATCH 2/5] RedfishPkg: Prevent assertion of allocate zero length region Thread-Index: AQHZbqnrhYlukjBjxUeW3P+NDMH70K8qgWIw Date: Fri, 14 Apr 2023 09:03:51 +0000 Message-ID: References: <20230414081903.7892-1-minhnguyen@os.amperecomputing.com> <20230414081903.7892-3-minhnguyen@os.amperecomputing.com> In-Reply-To: <20230414081903.7892-3-minhnguyen@os.amperecomputing.com> 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_|SJ0PR12MB7082:EE_ x-ms-office365-filtering-correlation-id: 009421a9-81db-4d23-f558-08db3cc72a8a x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: W5rbsqMHra9iszeO8W6vlo4XzUm4IwVyqSu+r/voEgMBPiPusuR00kG9cvAgxX0aQUPe6HNXD6SP7QSx3RjiuKIn4DccrMrhcn4Qd5Frl5E7/BMakNqpaxaNEWlwjCb4CweOq3Iid6t389tnSbULePY/uIecuaU3w/+nV3OiItjIQunuXlXh0Hdnt7eoNjthjZKlPu8pbzqldEuC21H5AJc331yeK7mNEkSiFK4xoukWQm87KQ33yozSdrAngNRmfnAqeE61vzYj/7bOhmr4LKjbijvMnyq61q4Qg0BPtZId4O3buidG4/bYgpXWST58GcVWknmqWoBMQdzK6uSGto+d1MwnVxzjQsPekxn8k9us3MKQOA62HBRS0SO0YRDqzmBdN4pjtAmcGgsSZXNUpZ6O5IRCmSzkCbgZKbPLAW4q2R3zkhUJyYjk5sXYgU/26yH+cUAIU9yqi0axcO7/kfkoxd/Z56dwg+7M8Fcj0PXgRugdjwua8qbKJcFvA/5iNFsDend1HRih+BYcg/NrqRRkNeaYhgU7RrtBE8eqYDucF3rhPrHHRppDMA8sS4Ij604cujRt7w289zOjEo2TKbRDmgP+LNkS3ez/j12UqHA= 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)(396003)(346002)(39860400002)(136003)(366004)(376002)(451199021)(71200400001)(7696005)(966005)(66476007)(66556008)(64756008)(66946007)(76116006)(4326008)(66446008)(2906002)(38070700005)(86362001)(38100700002)(122000001)(52536014)(41300700001)(5660300002)(33656002)(8936002)(8676002)(316002)(478600001)(110136005)(55016003)(54906003)(53546011)(9686003)(6506007)(26005)(186003)(83380400001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?O8DDgH3iYe9olxG4HSDQ4NfMlEJodWRXWMCVkkxBgZWsKRtDOWfimuWuMQC2?= =?us-ascii?Q?PkvPFV/Rzc0sBHVwfIGd+vZTap0PjK5QowkyujpMsyRI/swZ15d7fEf/6Slx?= =?us-ascii?Q?pRKiQ310/97Z0FMjEQq2it6jNw1WT9UgHFvV8LfaoGL5cA7NYbXxeUl6HH8e?= =?us-ascii?Q?UCpbZ6fq+0yZf6ZEe+JMErGP5Q6rKvQSRV2ej1T2MjLFJFLu2dnOWUJWcWjO?= =?us-ascii?Q?uioq+8l2AOdynq441sUINKBU9C6HdTQWiftec+q5hr1hIPb5FZC+ypAStppb?= =?us-ascii?Q?Qap10m/e5Uk5/9pitMfw4jGtfLpr4qCgKDicUD4RvvhS6H3StPUObXCd2ixr?= =?us-ascii?Q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rP3kV/2+KNCzpKhP?= =?us-ascii?Q?Nu4o0rSsD0fs+jGrO5I1lo0eI9/AUTyi+PwYI/XVT/U7O9Z1W3ON5PsdI2MU?= =?us-ascii?Q?DHOOer7i89vKDRaBkxm9gbbSKaFitXt8lb9hQLa0ABhCHpVRAIUO6qdcQwNp?= =?us-ascii?Q?cJsrr9cB++xCcX62+NLQhNMLw1UwjD4o68Z9VYl5kBUDsYXLCwyAMsJVy4rt?= =?us-ascii?Q?w4dopvWmimQu17ne1THahrld0CU3e3HUurwsDcrrdaEOd65KR4RqTudj3rtQ?= =?us-ascii?Q?mfasdUdcVIO1wAFXmM4KQ5sdgRaLie8P/ifIr5YAkL6NRPp+PDhubPyf+YPs?= =?us-ascii?Q?WOZFec7iuPjoAwHsRRw=3D?= 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: 009421a9-81db-4d23-f558-08db3cc72a8a X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Apr 2023 09:03:51.2376 (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: fNHb0vnXsxIpcFU80qRmpRWGKCS0U6kZ0mXTJ0rmUbIQ3dXdCYrRAMady5jTDsqVoSStxkV0SRxHCldJD15eNQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB7082 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Minh, > Prevent assertion of allocate zero length region May I know where does zero length allocation happen? According to my unders= tanding, setting the "SubnetAddrInfoIPv6Number" to zero here and it will be= handled by below condition check: https://github.com/tianocore/edk2/blob/55b67b6950e648338adfe8ec54aeb26ed89d= 2c97/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c#L1005 Then the code leaves function with EFI_NOT_FOUND error.=20 Thanks, Nickle > -----Original Message----- > From: Minh Nguyen > Sent: Friday, April 14, 2023 4:19 PM > To: devel@edk2.groups.io > Cc: patches@amperecomputing.com; abner.chang@amd.com; Nickle Wang > ; igork@ami.com; nhi@os.amperecomputing.com; > tinhnguyen@os.amperecomputing.com; Vu Nguyen > ; Minh Nguyen > > Subject: [PATCH 2/5] RedfishPkg: Prevent assertion of allocate zero lengt= h > region >=20 > External email: Use caution opening links or attachments >=20 >=20 > From: Vu Nguyen >=20 > This change also fix miscellaneous errors on condition checking and debug > argument missing. >=20 > Signed-off-by: Minh Nguyen > --- > RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) >=20 > diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c > b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c > index 583c6f78e19c..29e7b0624ebf 100644 > --- a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c > +++ b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c > @@ -5,6 +5,7 @@ > (C) Copyright 2021 Hewlett Packard Enterprise Development LP
> Copyright (c) 2022, AMD Incorporated. All rights reserved. > Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserv= ed. > + Copyright (c) 2023, Ampere Computing LLC. All rights reserved.
>=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > @@ -272,7 +273,7 @@ Tcp6GetSubnetInfo ( > if (IpModedata.AddressCount =3D=3D 0) { > DEBUG ((DEBUG_INFO, "%a: No IPv6 address configured.\n", __func__)); > Instance->SubnetAddrInfoIPv6Number =3D 0; > - return EFI_SUCCESS; > + return EFI_NOT_FOUND; > } >=20 > if (Instance->SubnetAddrInfoIPv6 !=3D NULL) { @@ -926,7 +927,7 @@ > AddAndSignalNewRedfishService ( > } >=20 > Status =3D gBS->SignalEvent (Instance->DiscoverToken->Event); > - if (!EFI_ERROR (Status)) { > + if (EFI_ERROR (Status)) { > DEBUG ((DEBUG_ERROR, "%a:No event to signal!\n", __func__)); > } > } > -- > 2.39.0