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.131]) by mx.groups.io with SMTP id smtpd.web11.5064.1681464055556142882 for ; Fri, 14 Apr 2023 02:20:55 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=vBOa8CL4; spf=pass (domain: os.amperecomputing.com, ip: 40.107.96.131, mailfrom: minhnguyen@os.amperecomputing.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cui51IkgT/1UrW9E/omVyQd6eb6ctTzFozk6SoorckaQgFMlsRTBjw9yDDCbjm/FtbavFT8rAUQKyZWil3Yl6yzD3HZpSqkwoKUjQxPqwNMv7JA/GFtbyNrlCoYUgoOtdQzBWvr8MSM8hoQssRseOX9A8ucrq71g+DU/3sxsB7KpSVCvbbaGkzH8/Gar8EPORrGUGNcsDeqpnn+k4OKooBJTaR8gpMCj5k36cn/m5Qw65lBXnmUtP+HLJmwI4K3qg6mr5683suCJnPhA4EGJkDEiG323W5EJWQwyQoBpbJQR2+Lh3k1vQnlAevBWkMy4NJoY59rQbWWoNkp/CTWC4g== 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=Phbm4IHdr9Uwn0wKWaIh27TfdehxuSGAPrv+YDn54tQ=; b=iBqyzBDBiBxSw9aMT+9rCxHefrNHsvCBMqG2lkVJx6k+uWiqPhDw7nlacOlQOhYGeHW6jVF0NJDSUMqNwfwprVpCIt3x44+6LGbCmOW9AlbIhgrI1u/Rozu41yqQrlVaOVZQ5s+pA56zC7KPa5B6PrVqzK8jkfNdhX3CsO+STC2XEkR2sXk9bzQLhyuvC1bqLr+24GOB7SFLq8DdY2yUh3PrteTNqFabjce1C72GNLA6E8cDXhmtpVXK/lz6gI03gB7DeG+v2+9oBeBQ9RtgwJE8SKQ1jwPFyQHihx3r6mpSBSPElQs9VtoUfg5l2z1svruwgLhg1PqHXjWnOJ9/NA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Phbm4IHdr9Uwn0wKWaIh27TfdehxuSGAPrv+YDn54tQ=; b=vBOa8CL4M4uQ+e2LclEMl2rXMpvIKxYfMGESFBGSQ3ZpJK0GD8B0al9ZtdyDUYe6Yk+sk163MyxjncWuvHAH7mPt+euynfFPbWhjBFlmO3U98Mm7eyuBxLpjmUOYKqEzwZhITSAq3dJmvGBTHgqN7ERmqW2iII0wuulHamqPZXM= Received: from BYAPR01MB4038.prod.exchangelabs.com (2603:10b6:a03:5b::28) by DM6PR01MB6105.prod.exchangelabs.com (2603:10b6:5:1cc::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.8; Fri, 14 Apr 2023 09:20:52 +0000 Received: from BYAPR01MB4038.prod.exchangelabs.com ([fe80::ca46:c19a:9542:40a6]) by BYAPR01MB4038.prod.exchangelabs.com ([fe80::ca46:c19a:9542:40a6%7]) with mapi id 15.20.6298.030; Fri, 14 Apr 2023 09:20:51 +0000 From: Minh Nguyen OS To: Nickle Wang , "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: AQHZbqnotbrnXgOkjk2iVZ7S1uytFa8qgruAgAAEblA= Date: Fri, 14 Apr 2023 09:20:51 +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=e320df78-25be-4ba3-9aa8-db06b06bd61f;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:19:41Z;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=os.amperecomputing.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BYAPR01MB4038:EE_|DM6PR01MB6105:EE_ x-ms-office365-filtering-correlation-id: 6ee3384e-86a3-49c5-0188-08db3cc98a5f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 5C7IiOxohUcL7UPPdCnl93O0XEMC4mVKD9q0AnaEzO6fLVhXm+NE9FhqAthRQTGpdu/v1hkMi2ELybbOAvuV/Lq3906JxLVzCURgBajm6xoA+0rBcU3Fvw9BW7Y+xXaZXxxDu9Tci1r/MOChbcfol3cYJ2rOCY8A4wcD59a1iBdW/KXqugtnmLMIXSb8hY/mBXmvhK0NufcRpN7WEiQnF2CZk9ppNUqEDWsSkPgQLQTayVvRk8+0ru7nGbowTXUsfADi64/cd9rNKOSMbbIJGRYG9zvaT/Y3XHONwha9WTDHTaDefmbnY50T7FxTAk8jJ2QxlNvxyrA2IlnDTh3EYcFooxa9ItZru3kA2nqRFzLp1sgnxMWprh+TzAkMLxR34nk0F4yhiAxItEgAfJvCPfF9gqdaTM+U+juXns9cBsXf1/9RYtHTZ12yoz2+YMNHV4/+O7bDVcProhFM3opdXQKvw6KZ03McUhxFtByWVHzLP/WOMdfH2UEZBReGguKz6IzoRnKmqrf89N8VcF7RaKEinLeQC7Sj9bUPioPO91Ycx41kws9BVtD/7nXErvGh/R5OdaGj5Phhz7p8DE2WRz8AVAzUFJyLBh1/L0yPHBU= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR01MB4038.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39850400004)(136003)(396003)(346002)(366004)(376002)(451199021)(107886003)(55016003)(83380400001)(55236004)(53546011)(9686003)(6506007)(26005)(186003)(64756008)(66446008)(66476007)(66556008)(66946007)(86362001)(38100700002)(76116006)(4326008)(2906002)(38070700005)(41300700001)(122000001)(110136005)(316002)(54906003)(33656002)(478600001)(7696005)(8936002)(8676002)(5660300002)(52536014)(71200400001)(966005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?UTrJcGsFCJU+04ytdnngal0yE9ziF2B+jbp60QCDp40fW11Xw+HaKUx5IARj?= =?us-ascii?Q?wgY+Wgdw34LPlkaMpVM92TWUfWtoM2XpkRT9Ql35k1F/W2+Sm578bGM8dLFy?= =?us-ascii?Q?J/ZiYQCJkGW7i0Nsx/buHvSR6eiSbOeseVW7NHlJfbo9UTr8Lggm/NMujk5K?= =?us-ascii?Q?E+5hCFGUUOWK1Mx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ascii?Q?8u8nUdx3OMd8uu6rAUJ07PbGDmuhg7P9rfhsq6o1V1S9E601DjZwB8H9B1ba?= =?us-ascii?Q?JNjjdZuf1kRhJW2g+Vjkv0uqRIoac8Y2eHsMy1XniDuK3p+m5vBg/48mcViT?= =?us-ascii?Q?Elxm89HQBtpE3EdX14Cwz4M0pkZwbEMRttZAoFn0kM3gcf952a/IP6E69ttb?= =?us-ascii?Q?xYGK840ZSEnLV2AikBDcrrTCG1+p/17x3OClXZYOeHyxe8HLCjev4JlIPH7q?= =?us-ascii?Q?7u9yqB41VTbPQZjWnKt/+NdgFPO96ySlA523eM64vJqjRDe4dxg/ft65kzkM?= =?us-ascii?Q?eUn/sKBnqHHiWHczmBNmf8N15U3k16gOWeSZYYjiJfPyQnHKgSeUbD5Penx0?= =?us-ascii?Q?R/u7ZQKJfRe2CReCgNJiFlOLWqyP7+Pr7s3fzuPFpUjNVJXRIDiR/tE6APMp?= =?us-ascii?Q?BElpyvvsS6Mu6igDw24OdLS/lXa0zzpxLis8jucmHiGeeJAe/Jn7MdCvgADb?= =?us-ascii?Q?ffRb3WwLJk2bZ1sPB5f+hDrPWODoeLwEGkcnnSbbpAz1PvLqp1n+YDHMyJ9S?= =?us-ascii?Q?aVZIbtMaIEIjwGfn7dqeB1k=3D?= MIME-Version: 1.0 X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR01MB4038.prod.exchangelabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6ee3384e-86a3-49c5-0188-08db3cc98a5f X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Apr 2023 09:20:51.0406 (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: Lfn2vgDAavBe7AUiY9winhCv3iK4l9OsjkvODymum8SqY6w2qYpO9qXQ92XzNgsgLUmuJBKlbFZPViBb2fVQy4LCC0JWdf4Dgh5+jp5PwT6C0X8cebRDURiaO5FHOILX X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR01MB6105 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 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=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 >=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=20 > 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 @@=20 > 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