public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Nickle Wang" <nicklew@nvidia.com>
To: Minh Nguyen <minhn@amperecomputing.com>,
	Minh Nguyen OS <minhnguyen@os.amperecomputing.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: Open Source Submission <patches@amperecomputing.com>,
	"abner.chang@amd.com" <abner.chang@amd.com>,
	"igork@ami.com" <igork@ami.com>,
	Nhi Pham OS <nhi@os.amperecomputing.com>,
	Tinh Nguyen OS <tinhnguyen@os.amperecomputing.com>,
	Vu Nguyen OS <vunguyen@os.amperecomputing.com>
Subject: Re: [PATCH 2/5] RedfishPkg: Prevent assertion of allocate zero length region
Date: Fri, 14 Apr 2023 09:28:18 +0000	[thread overview]
Message-ID: <MW4PR12MB7031E1CA45E52A17EEA87B8DD9999@MW4PR12MB7031.namprd12.prod.outlook.com> (raw)
In-Reply-To: <PH7PR01MB7557C1802337098E5A2C7D6CA7999@PH7PR01MB7557.prod.exchangelabs.com>

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 <minhn@amperecomputing.com>
> Sent: Friday, April 14, 2023 5:18 PM
> To: Nickle Wang <nicklew@nvidia.com>; Minh Nguyen OS
> <minhnguyen@os.amperecomputing.com>; devel@edk2.groups.io
> Cc: Open Source Submission <patches@amperecomputing.com>;
> abner.chang@amd.com; igork@ami.com; Nhi Pham OS
> <nhi@os.amperecomputing.com>; Tinh Nguyen OS
> <tinhnguyen@os.amperecomputing.com>; Vu Nguyen OS
> <vunguyen@os.amperecomputing.com>
> Subject: RE: [PATCH 2/5] RedfishPkg: Prevent assertion of allocate zero length
> 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 <nicklew@nvidia.com>
> Sent: Friday, April 14, 2023 4:04 PM
> To: Minh Nguyen OS <minhnguyen@os.amperecomputing.com>;
> devel@edk2.groups.io
> Cc: Open Source Submission <patches@amperecomputing.com>;
> abner.chang@amd.com; igork@ami.com; Nhi Pham OS
> <nhi@os.amperecomputing.com>; Tinh Nguyen OS
> <tinhnguyen@os.amperecomputing.com>; Vu Nguyen OS
> <vunguyen@os.amperecomputing.com>
> Subject: RE: [PATCH 2/5] RedfishPkg: Prevent assertion of allocate zero length
> region
>
> [EXTERNAL EMAIL NOTICE: This email originated from an external sender.
> Please 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
> 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=05%7C01%7Cnicklew%40nvidia.com%7Cca169d4eb55a4b11fb8a08db
> 3cc925aa%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C6381706068
> 44107782%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2l
> uMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=4MAT%
> 2FDmrUBy%2BVF1%2F%2BNVTxg0iNOQtJJ%2BdlzXrNiluFA8%3D&reserved=0
>
> Then the code leaves function with EFI_NOT_FOUND error.
>
> Thanks,
> Nickle
>
> > -----Original Message-----
> > From: Minh Nguyen <minhnguyen@os.amperecomputing.com>
> > Sent: Friday, April 14, 2023 4:19 PM
> > To: devel@edk2.groups.io
> > Cc: patches@amperecomputing.com; abner.chang@amd.com; Nickle Wang
> > <nicklew@nvidia.com>; igork@ami.com; nhi@os.amperecomputing.com;
> > tinhnguyen@os.amperecomputing.com; Vu Nguyen
> > <vunguyen@os.amperecomputing.com>; Minh Nguyen
> > <minhnguyen@os.amperecomputing.com>
> > Subject: [PATCH 2/5] RedfishPkg: Prevent assertion of allocate zero
> > length region
> >
> > External email: Use caution opening links or attachments
> >
> >
> > From: Vu Nguyen <vunguyen@os.amperecomputing.com>
> >
> > This change also fix miscellaneous errors on condition checking and
> > debug argument missing.
> >
> > Signed-off-by: Minh Nguyen <minhnguyen@os.amperecomputing.com>
> > ---
> >  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<BR>
> >    Copyright (c) 2022, AMD Incorporated. All rights reserved.
> >    Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
> > +  Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
> >
> >    SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> > @@ -272,7 +273,7 @@ Tcp6GetSubnetInfo (
> >    if (IpModedata.AddressCount == 0) {
> >      DEBUG ((DEBUG_INFO, "%a: No IPv6 address configured.\n", __func__));
> >      Instance->SubnetAddrInfoIPv6Number = 0;
> > -    return EFI_SUCCESS;
> > +    return EFI_NOT_FOUND;
> >    }
> >
> >    if (Instance->SubnetAddrInfoIPv6 != NULL) { @@ -926,7 +927,7 @@
> > AddAndSignalNewRedfishService (
> >      }
> >
> >      Status = 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


  reply	other threads:[~2023-04-14  9:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-14  8:18 [PATCH 0/5] Adding necessary changes for RedfishPkg Minh Nguyen
2023-04-14  8:18 ` [PATCH 1/5] RedfishPkg: Correct variable type to prevent memory corruption Minh Nguyen
2023-04-14  8:52   ` Nickle Wang
2023-04-14  8:19 ` [PATCH 2/5] RedfishPkg: Prevent assertion of allocate zero length region Minh Nguyen
2023-04-14  9:03   ` Nickle Wang
2023-04-14  9:17     ` minhn
2023-04-14  9:28       ` Nickle Wang [this message]
2023-04-14  9:20     ` Minh Nguyen OS
2023-04-14  8:19 ` [PATCH 3/5] RedfishPkg: Create RestEx child on selected interface Minh Nguyen
2023-04-16  4:36   ` Chang, Abner
2023-04-20  1:23     ` Minh Nguyen OS
2023-04-20  1:28       ` Chang, Abner
2023-04-20  1:33         ` Minh Nguyen OS
2023-04-14  8:19 ` [PATCH 4/5] RedfishPkg: Add missing newline character Minh Nguyen
2023-04-14  8:53   ` Nickle Wang
2023-04-14  8:19 ` [PATCH 5/5] RedfishPkg: Fix compile issue on Linux Minh Nguyen
2023-04-14 14:13   ` Chang, Abner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MW4PR12MB7031E1CA45E52A17EEA87B8DD9999@MW4PR12MB7031.namprd12.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox