From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (NAM02-SN1-obe.outbound.protection.outlook.com [40.107.96.117]) by mx.groups.io with SMTP id smtpd.web10.4931.1681463882543450637 for ; Fri, 14 Apr 2023 02:18:02 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amperecomputing.com header.s=selector2 header.b=MrGM6EZz; spf=pass (domain: amperecomputing.com, ip: 40.107.96.117, mailfrom: minhn@amperecomputing.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JnX2iBqcLl0ymOSz6KqrRMDy5lhnbumISH0qqvW0YnT2llLltA9CgCzgKpfwDvhAYoXICW4NlSGtFw8CGBmjSZsEdTTBjjKHnxyivsVcVGUhhyEIp8Wn6ucys1LaFa7t9XLUQ9BIffTEiD81VMayYWGFZ7fWD8Y9XHGBzE70sFaFQuD5yPswiP2J1xPpsUE83gTx8KMnHYUh6D/Esem9t44EAGSg2GmyvIVqxK37x5wCsGpLcZ/FLRrIR3GuINlW7KuY5S2Ur1sH9gRIcTSio3sYBYij7RP+mVUivTSBJZinsJTexVeuiUidn/G6VCr+21tq9SdZBjNxzyOPZk3fvA== 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=wr96LyxPgd/bja90UCUWUph4/i70rwr/PWlWU6udDLU=; b=RcTFVAy+RCA2ypjc1GpkXCiArWCbMJKZefQMzN1cnWhxrZ8o9qXjlzXVm0MTxfR71F0FfssSz0Rgpp/UMRjUuAA//oBmlxj0O2HPwGNhiFQvXhKOmjovJ48I67NmyYRsOD/IjlA292Tb41u7JOEBiSI+rN46e4sT0v0ZqPjCIzagZux+KHYl/igojgSrHcc1gsOsfezadfjV1MCBFQ5XHFzOEz5GwbM7wap6+mR1CFR7HYEDURuASKwt3azCzGBlDqr2bT8RbYWstlWLMjNp1zdCvXUvL+d1rKnmJL6gKsyLoG8Jvlp5MHNXQI0jckN6P8yLtBx6ZHrYA/2XJHt1fQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amperecomputing.com; dmarc=pass action=none header.from=amperecomputing.com; dkim=pass header.d=amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wr96LyxPgd/bja90UCUWUph4/i70rwr/PWlWU6udDLU=; b=MrGM6EZz1gjGUU4FcUIeOSvP9fpWUd4dDbGz+IzMpneLx9Z0Y6t5Np3iQaWC7VwBIclbAqxPzgyPaxqfIahPc2Fde2at+d4ORR5RD0a8IhtioutwEKakNwMo6lUFWcV6pt2MPFFOw6xkz5pAu9VZ7/W42eSe48fLOfwgf/ZmYbokqd4PQ/YusvBvsU0QolniiE98JoKRLFyQ0caDlegffptPYnjLsNo8OAdf8I1YeFMey1ElrZ+Jq+k0RwyOgg+TzB9LlC8qxY0DPW0XdrdFOIa1DlZv/BpjPd4owm4m1MZEodhd4BfqcwRKd51rptnVH80YF7N6rRx4+mnqqCh0Ww== Received: from PH7PR01MB7557.prod.exchangelabs.com (2603:10b6:510:1e0::9) by BN7PR01MB3748.prod.exchangelabs.com (2603:10b6:406:8a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.26; Fri, 14 Apr 2023 09:17:57 +0000 Received: from PH7PR01MB7557.prod.exchangelabs.com ([fe80::4f96:f572:b51:b4e2]) by PH7PR01MB7557.prod.exchangelabs.com ([fe80::4f96:f572:b51:b4e2%5]) with mapi id 15.20.6319.008; Fri, 14 Apr 2023 09:17:56 +0000 From: minhn@amperecomputing.com 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 length region Thread-Topic: [PATCH 2/5] RedfishPkg: Prevent assertion of allocate zero length region Thread-Index: AQHZbqnp6KiFfV6flEWeie9mpge/ra8qgruAgAACt1A= Date: Fri, 14 Apr 2023 09:17:56 +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_ActionId=c24e9c27-4108-4c6d-a56a-7767b2e559bf;MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_ContentBits=0;MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_Enabled=true;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_SetDate=2023-04-14T09:13:33Z;MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_SiteId=3bc2b170-fd94-476d-b0ce-4229bdc904a7; authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amperecomputing.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH7PR01MB7557:EE_|BN7PR01MB3748:EE_ x-ms-office365-filtering-correlation-id: a7ee469e-c2ab-40d3-aa2e-08db3cc9227d x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: MQGwkNsmxfihUTHTgtCMveoJBc0TnWm8ypzZ84wFixmJpbRarR8xauuUlhGKL8WrG86S0UHEwd4jXwjVe9mwZKUe9jGh7fxtzx+rvDPXZ+dh8Hwq66Sz3TumkdX3EJgfWaABEaUVCH12INgDwM3GFOugtOef3oHHPIopFOQEIiacj1dP6R/Ww+uUg0exFt0B9FpAVLGp22KjY0TA3Ri8wGK6ukgLbVPmwnMnXqmIziRs7IuSYtziV1moH50nNR4+vu7qb4Mm5ymCJC8ixJEDWsMwB7C86sFj+vHyYB6Xnz6V5xiC7oXWpRVV34tNx0Lgc99qP0fQtUgXMR8zYT0BDnPfLN+dG0/UrhvayEKmDifDrmbj8aqNBrYGlyu/8bZ6CJmsp46eDwenlqKMr3CRalz3Rvtq00XY7Uq7yAaFh3zSxU7pia042XezCAdgKoGc3PDgCqI44EZMhvfG80S7FPNtBThn/Lyr4g4MCGM6CtZp6Oeal6QzgD+tYW/+xQ4RCnvwmrLr1v67l4TH0LLlzL/3WitRaubzinOqknYzY592XAg+qO96zWY4aTdPqxOC/cyIHwVrWPw22HEvm6p84VZyb+hNE4guSzNQsk+vLUY= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR01MB7557.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39850400004)(346002)(376002)(136003)(366004)(396003)(451199021)(71200400001)(478600001)(7696005)(52536014)(33656002)(55236004)(83380400001)(122000001)(38100700002)(86362001)(55016003)(38070700005)(2906002)(9686003)(66556008)(5660300002)(66446008)(110136005)(966005)(316002)(6506007)(26005)(53546011)(186003)(66476007)(64756008)(41300700001)(107886003)(8676002)(8936002)(54906003)(4326008)(66946007)(76116006);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?BSdZqCPMxNADcEv2Q44EJM9gg12enN9cGcAxeQzLl9rPkC74NjjFrz+iq6Wf?= =?us-ascii?Q?tbCaTVEcHVuV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ascii?Q?/rfaslQnBMGOH3hh1WyUd+pUA/Li3fIG0aD6VsMzvvGwa5WAb7dZd3FLF+Bo?= =?us-ascii?Q?W1na/099En24Y+uXuaAwAL3QWTlE1AiUGSmyhPwB8azmPOuNnpgfHaEcx96w?= =?us-ascii?Q?Xss4Qjgo/662DxWja0KWhGQDGf13AG4R3PSks5nc7jTVQmZuxfsaiQhIalGT?= =?us-ascii?Q?rySCz9NAlPWVxpbaFRavSuepqD0lOehDADeeOmhWOhiWhetz8oziCt2C9LI0?= =?us-ascii?Q?vHwi2pQhGdbIPwkXnIxflnRhxc9eu51p7YZ64sPRWnLAmD3obkVATUBmOnRF?= =?us-ascii?Q?OfQuxbMBfkj2e9BPmiYeHg4Xq/hJozue/KPL+UQbn1fVS3MPCoYSFTPbIEsQ?= =?us-ascii?Q?0QQPl2jMpwwBIJX/IyfBRlcGQaiA7L5+etQqp5XeVf2oTl2ipjJvebelML5e?= =?us-ascii?Q?bvhJTnVf3ji13Ba2iA+W5kTTZf9zQtEns8pM+dT8Wb6NMczjDYsaGKubJXww?= =?us-ascii?Q?Jz0VC9gtwNIrdOpFX9O80ImaLrGVpCcscqdEJ2zHWYGcyG9s808kk/X+Up3e?= =?us-ascii?Q?ZcX2ZuYYWCAeZ41g3Nra3crrGcI4APAOJ/IonDDyHNItuwKU66jksBsDdjN3?= =?us-ascii?Q?oM4I/4w3sm+NwgdRK7Y5JeO91/mqGaPvLB6DgIeb?= MIME-Version: 1.0 X-OriginatorOrg: amperecomputing.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH7PR01MB7557.prod.exchangelabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: a7ee469e-c2ab-40d3-aa2e-08db3cc9227d X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Apr 2023 09:17:56.7433 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: kKehDDCFb0RnmNkMa+1E6bhc63NHq5SiC7nURc90MNs2XvZ8R/Gac338/+JFShkvk5Ws1HgDnKhrCMLVoly/mk4e8i7sRv8FxnvxWkdb7uQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR01MB3748 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Wang, Thanks for this point, you're right. It's a redundant change and I will up= date in v2 patches, but the second change is necessary. How do you think ab= out that? Thanks, Minh Nguyen -----Original Message----- From: Nickle Wang =20 Sent: Friday, April 14, 2023 4:04 PM To: Minh Nguyen OS ; devel@edk2.groups.i= o Cc: Open Source Submission ; abner.chang@amd.c= om; igork@ami.com; Nhi Pham OS ; Tinh Nguyen OS= ; Vu Nguyen OS Subject: RE: [PATCH 2/5] RedfishPkg: Prevent assertion of allocate zero len= gth region [EXTERNAL EMAIL NOTICE: This email originated from an external sender. Plea= se be mindful of safe email handling and proprietary information protection= practices.] 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. 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=20 > ; igork@ami.com; nhi@os.amperecomputing.com;=20 > tinhnguyen@os.amperecomputing.com; Vu Nguyen=20 > ; Minh Nguyen=20 > > Subject: [PATCH 2/5] RedfishPkg: Prevent assertion of allocate zero=20 > length region > > External email: Use caution opening links or attachments > > > From: Vu Nguyen > > This change also fix miscellaneous errors on condition checking and=20 > 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 reserv= ed. > + 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 @@=20 > 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