Re: [PATCH] s390/netiucv: handle memory allocation failure in conn_action_start()

From: Yunseong Kim
Date: Mon Jun 24 2024 - 14:01:06 EST


Hi Markus,

On 6/23/24 11:27 오후, Markus Elfring wrote:
>> This patch handle potential null pointer dereference in
>> iucv_path_connect(), When iucv_path_alloc() fails to allocate memory
>> for 'rc'.
>
> 1. Can a wording approach (like the following) be a better change description?
>
> A null pointer is stored in the data structure member “path” after a call
> of the function “iucv_path_alloc” failed. This pointer was passed to
> a subsequent call of the function “iucv_path_connect” where an undesirable
> dereference will be performed then.
> Thus add a corresponding return value check.

Thank you very much for your detailed code review. I will thoughtfully
incorporate your advices into the next patch.

> 2. May the proposed error message be omitted
> (because a memory allocation failure might have been reported
> by an other function call already)?

I agree.

> 3. Is there a need to adjust the return type of the function “conn_action_start”?

I had the same thoughts while writing the code. Thank you!

> 4. Would you like to add any tags (like “Fixes”) accordingly?

Yes, I will refer to the mailing list and include the fix tag.

> 5. Under which circumstances will development interests grow for increasing
> the application of scope-based resource management?
> https://elixir.bootlin.com/linux/v6.10-rc4/source/include/linux/cleanup.h#L8

I am considering the environment in which the micro Virtual Machine
operates and testing the s390 architecture with QEMU on my Mac M2 PC.
I have been reviewing the code under the assumption of using a lot of
memory and having many micro Virtual Machines loaded simultaneously.

> Regards,
> Markus

I really appreciate code review Markus!


Best regards,

Yunseong Kim