From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.69]) by mx.groups.io with SMTP id smtpd.web11.5125.1681464501090747486 for ; Fri, 14 Apr 2023 02:28:21 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=selector2 header.b=G3mlMb8J; 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.220.69, mailfrom: nicklew@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DeJQvk9F9PJ/uYMicoP0k4KzV4ek3bJncQ6lKynhYwVJxrI3w96IK98NINzFs+0whchdW3TGafdFAAROW1Ol6fdh3Eie++mh482pDyuoZLu8qcMVUzCSxr9urEqHtQ9QcGOPKRezrdM6hnCx1bRbG+lIEUwdQ/gDPikv6IQd8NgN+V+IIw1GI4tD5E+sDhLNR5WMpJcpPvOXfcAUFNPLjtlp1BMX6hSgx2DHr0udnhhfRycboa4MpIsufSLjLypU4o3Yhv2DbGxY4bTCkTgC+cnvB2+AFyjbEpo6wznzw4A+ABYP/ONPaxXeOv8Ut/LWq5bLbmKSR5FnqG6YpOPD9g== 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=OL0+1SUnfJagkiSYJs9KkDDs0c3bDhC0YbdxpWGFA/M=; b=SncCIGIZ/SUuHeszZr8h9pkTONwwEi46pkSXO7lKSrV33u7FwsEizUlwWPt4XqE9wx7bbkdvy4RThnZqE/ZA3ZFH84Ov5jcTs51EawiZfhhTpIIvH4WNg1UplkRV2iT2OHWRGf28XKxcOisfM6jRlLuVh7apwd300Df+WXm5zE8c51va2T4X+nzKpDmq2cCz5MYgXExvwEnZTqqYBBwEh9kcKQwduyNtZ+aSFfdJtmrCEZw12f/uv/1By+9Qf88rMSpoG2t+jRYVsFmTLg7+l/TYtbXUF5QeAxsPZ5m1d0PU6tnjb45DOMLwfQT36QMJP4ozsQNVoxhs4YFql2PnuA== 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=OL0+1SUnfJagkiSYJs9KkDDs0c3bDhC0YbdxpWGFA/M=; b=G3mlMb8JlPEuaTEuObR2KnfpJhG05cnSia1Vfq1TdhkK22N5mdLAKWkmNIym/LFhvWI/VtqoY+5wSkyV16DJXlb+7sd9ZT8yq5KD8UDxtMQTskhP+HJNDHsaEg0EYLI2c9/nohmwmzrnE7HzAZEfBNOqBQisj4n4rWnU98LTtb5Db2zcdHxI6TFnVRZ6Z7EbuYdf58AOe84dhff4G5cAbZTkFusUQfLlCrmI4TUlP8jk3QGUpBwkRIiNbN5Ii0IItjCZGvRuOlwvgy61/vUje/hiOtocOQl/cK7ELkD3U9GlkMdB5FO7XrrM2lLSNfk0tkMPn38BuqHNRaj1CBvl5A== Received: from MW4PR12MB7031.namprd12.prod.outlook.com (2603:10b6:303:1ef::6) by DM6PR12MB4372.namprd12.prod.outlook.com (2603:10b6:5:2af::14) 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:28:18 +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:28:18 +0000 From: "Nickle Wang" To: Minh Nguyen , Minh Nguyen OS , "devel@edk2.groups.io" CC: Open Source Submission , "abner.chang@amd.com" , "igork@ami.com" , Nhi Pham OS , Tinh Nguyen OS , Vu Nguyen OS 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+NDMH70K8qgWIwgAAFSQCAAAH+AA== Date: Fri, 14 Apr 2023 09:28:18 +0000 Message-ID: References: <20230414081903.7892-1-minhnguyen@os.amperecomputing.com> <20230414081903.7892-3-minhnguyen@os.amperecomputing.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_Enabled=true; MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_SetDate=2023-04-14T09:13:33Z; MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_Method=Standard; MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_Name=Confidential (Default); MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_SiteId=3bc2b170-fd94-476d-b0ce-4229bdc904a7; MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_ActionId=c24e9c27-4108-4c6d-a56a-7767b2e559bf; MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_ContentBits=0 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_|DM6PR12MB4372:EE_ x-ms-office365-filtering-correlation-id: 112c9d54-20fb-4a03-b792-08db3cca951a x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 7EKQ8pbLNFQwsiUyNbJcGMOmYw+are6yj4FtfPDQeFGhi8yuDv3AhSUnL+MqfsSI1YHVN03LlOEaEgiG+3ny+TAlK0eI75tup2zmJEOfv3FhYPaE63A93tZP9ILyT/SI4ZVeHAhPOKEzCpeHmiMdBz+N8c0iyxzu2lBBLomO2+sI/tvkRl6y/GoV+vGkzlbeyba3ux3wFJLitUXCpG84JGOruh3AKDCiJhOs8Pt5wP5i1Qey7mWJq7NlFdFAXKrTlZ0Bcf4P5urVMtiCWHXop0SksKIhFi5QKwqbcEwARLZDjZjvNUxxD5bIl5vknaDzOz4m/Vd6pdjoPYiO0SHDNemcp7QHuJQXN0ALpd8MGwE15dVLezzL7aUhXD0PQUFYU9tWNlf+zocvZH9vw5j1tkBsLmyXfYcXRLUVBSWE/M6xbhdKZssVrVTsXtKWOalFVbiWTduA/cN13aZRjNkpg2U31Du+pQCBJ1zApWBkWuK1GYOgqhZDGakjYc9jeIev9jkXTTCagqFmTj9znRQStbVhj/LZeVqzv8j11GNBGg9mDsB9MrN9YB0kZNfv4Ldgt4lqeoApY8AKDxQ6On55TXxwvD+H/vciNVsBwAnKGgw= 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)(45080400002)(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?hZFlHEspi7HWSCZvd9vf7M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?us-ascii?Q?Ss1FfopInAS/Wqc62w+RbeV7K+l/Cr+f6FsdSkJSqdWmRpPmGR91bbtly2E5?= =?us-ascii?Q?EbjZtIcpIEQhxkgLfBrxVu8vHofYozPhO/TXGBWF1Smjqm0V2pmOsUHtgYq/?= =?us-ascii?Q?ZfcrlICyPYbo+AWjiUU4+m/JF0E1acgwLpzk9jkEIkzelZGuau7CHEWLv3mx?= =?us-ascii?Q?hwdOk7g94bgPIq0hU6zfpsrhc0AuYerTfcH9DY2NI1Uv2S4z98+qVvk1mjqX?= =?us-ascii?Q?TaaU73S75LNUNV2pbhFG+1WhQLA02I6ECQObtQIxgW/NZumspEhCzb/Yvhvr?= =?us-ascii?Q?VIgAEuyYBvCaXLfZOzKG545ttg5U4GjFOh+nNQ7sq0fVyVrTFO9zNB99O7Mm?= =?us-ascii?Q?3dac599aBbXJ5n7SmFq6zkg3t7f432SNGyO0nls5KLJPAibYhuvA/2Dn+Gro?= =?us-ascii?Q?CgsGry4iVvfIdcizF962GTiG6ZYepTGdSOwa+UJNj3zdwEn3tn9wAKjXuet1?= =?us-ascii?Q?/H7b5FBlkRx69QOU+LuEmhzlJKkebz41JScnhUUL8IgacyIXvLVcTwYoQDVq?= =?us-ascii?Q?PKkmJupju8pgxIljHi5N6cGd+VNJjnebPQ6ixOTYNdYEjvfrv6uYVAOLwAJ6?= =?us-ascii?Q?ygksaV6uRm/an8QaqAvj6dUUs8w2UpgUG5wvJzq3pyS9sg1ataf++OY8aiAa?= =?us-ascii?Q?krvmpWHM/jrCaRK3Kzg=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: 112c9d54-20fb-4a03-b792-08db3cca951a X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Apr 2023 09:28:18.5289 (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: VSLo0SI2o3nuT5SRYZ08m6g75jMrGLKBb46MXWqVxQqNstBsoHibp7EJw20ra3NChmSIga8uKZVONErmjKlHsA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4372 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks for your quick response. > but the second change is necessary. How do you think about that? Yes, second change is necessary. Please keep second change in v2 patches. Thanks, Nickle > -----Original Message----- > From: Minh Nguyen > Sent: Friday, April 14, 2023 5:18 PM > To: Nickle Wang ; Minh Nguyen OS > ; devel@edk2.groups.io > Cc: Open Source Submission ; > abner.chang@amd.com; igork@ami.com; Nhi Pham OS > ; Tinh Nguyen OS > ; Vu Nguyen OS > > Subject: RE: [PATCH 2/5] RedfishPkg: Prevent assertion of allocate zero l= ength > region > > External email: Use caution opening links or attachments > > > Hi Wang, > > Thanks for this point, you're right. It's a redundant change and I will = update in v2 > patches, but the second change is necessary. How do you think about that? > > Thanks, > Minh Nguyen > > -----Original Message----- > From: Nickle Wang > Sent: Friday, April 14, 2023 4:04 PM > To: Minh Nguyen OS ; > devel@edk2.groups.io > Cc: Open Source Submission ; > abner.chang@amd.com; igork@ami.com; Nhi Pham OS > ; Tinh Nguyen OS > ; Vu Nguyen OS > > Subject: RE: [PATCH 2/5] RedfishPkg: Prevent assertion of allocate zero l= ength > region > > [EXTERNAL EMAIL NOTICE: This email originated from an external sender. > Please be mindful of safe email handling and proprietary information prot= ection > practices.] > > > Hi Minh, > > > Prevent assertion of allocate zero length region > > May I know where does zero length allocation happen? According to my > understanding, setting the "SubnetAddrInfoIPv6Number" to zero here and it= will > be handled by below condition check: > > https://github.c/ > om%2Ftianocore%2Fedk2%2Fblob%2F55b67b6950e648338adfe8ec54aeb26ed8 > 9d2c97%2FRedfishPkg%2FRedfishDiscoverDxe%2FRedfishDiscoverDxe.c%23L10 > 05&data=3D05%7C01%7Cnicklew%40nvidia.com%7Cca169d4eb55a4b11fb8a08db > 3cc925aa%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C6381706068 > 44107782%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2l > uMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3D4MAT% > 2FDmrUBy%2BVF1%2F%2BNVTxg0iNOQtJJ%2BdlzXrNiluFA8%3D&reserved=3D0 > > Then the code leaves function with EFI_NOT_FOUND error. > > 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 > > length region > > > > External email: Use caution opening links or attachments > > > > > > From: Vu Nguyen > > > > This change also fix miscellaneous errors on condition checking and > > debug argument missing. > > > > Signed-off-by: Minh Nguyen > > --- > > RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > 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 rese= rved. > > + Copyright (c) 2023, Ampere Computing LLC. All rights reserved.
> > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > @@ -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; > > } > > > > if (Instance->SubnetAddrInfoIPv6 !=3D NULL) { @@ -926,7 +927,7 @@ > > AddAndSignalNewRedfishService ( > > } > > > > 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