[edk2-devel] [PATCH v2 1/6] RedfishClientPkg: fix crash on access to uninialized list variable.

Chang, Abner via groups.io abner.chang=amd.com at groups.io
Thu Aug 31 03:28:47 UTC 2023


[AMD Official Use Only - General]

Yes Nickle,
I agree to have a common API for initializing the structure members.

Thanks
Abner

From: Nickle Wang <nicklew at nvidia.com>
Sent: Wednesday, August 30, 2023 9:48 AM
To: Mike Maslenkin <mike.maslenkin at gmail.com>; devel at edk2.groups.io; Chang, Abner <Abner.Chang at amd.com>
Cc: igork at ami.com
Subject: RE: [PATCH v2 1/6] RedfishClientPkg: fix crash on access to uninialized list variable.

Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.


Reviewed-by: Nickle Wang <nicklew at nvidia.com<mailto:nicklew at nvidia.com>>



@abner.chang at amd.com<mailto:abner.chang at amd.com>, I am thinking that we may need to provide allocation function for CS structure so caller does not need to handle linked-list initialization like this one, or other stuff requies understanding to CS structure implementation.



Regards,

Nickle



> -----Original Message-----

> From: Mike Maslenkin <mike.maslenkin at gmail.com<mailto:mike.maslenkin at gmail.com>>

> Sent: Tuesday, August 29, 2023 4:01 PM

> To: devel at edk2.groups.io<mailto:devel at edk2.groups.io>

> Cc: abner.chang at amd.com<mailto:abner.chang at amd.com>; Nickle Wang <nicklew at nvidia.com<mailto:nicklew at nvidia.com>>;

> igork at ami.com<mailto:igork at ami.com>; Mike Maslenkin <mike.maslenkin at gmail.com<mailto:mike.maslenkin at gmail.com>>

> Subject: [PATCH v2 1/6] RedfishClientPkg: fix crash on access to uninialized list

> variable.

>

> External email: Use caution opening links or attachments

>

>

> Signed-off-by: Mike Maslenkin <mike.maslenkin at gmail.com<mailto:mike.maslenkin at gmail.com>>

> ---

>  RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c | 2 ++

>  1 file changed, 2 insertions(+)

>

> diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c

> b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c

> index b9c799e07684..a1738de46fdf 100644

> --- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c

> +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c

> @@ -97,6 +97,8 @@ RedfishConsumeResourceCommon (

>    if (BiosCs->Attributes == NULL) {

>

>      BiosCs->Attributes = AllocateZeroPool (sizeof

> (RedfishBios_V1_0_9_Attributes_CS));

>

>      ASSERT (BiosCs->Attributes != NULL);

>

> +    // initialize list

>

> +    BiosCs->Attributes->Prop.ForwardLink = &BiosCs->Attributes->Prop;

>

>    }

>

>

>

>    //

>

> --

> 2.32.0 (Apple Git-132)




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108183): https://edk2.groups.io/g/devel/message/108183
Mute This Topic: https://groups.io/mt/101027003/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/edk2-devel-archive/attachments/20230831/9b3ff36e/attachment.htm>


More information about the edk2-devel-archive mailing list