Re: [PATCH] fs: smb: client: Add missing check for kstrdup()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Add check for kstrdup() in smb3_reconfigure in order to guarantee

      checks?             calls?             ()


> the success of allocation.

I suggest to take further patch/code review concerns better into account.


…
> Signed-off-by: Haoxiang Li <make24@xxxxxxxxxxx>

Will requirements be reconsidered once more for the Developer's Certificate of Origin?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.10-rc6#n398


How do you think about to use a summary phrase like “Complete error handling
in smb3_reconfigure()”?


…
> +++ b/fs/smb/client/fs_context.c
> @@ -920,6 +920,8 @@ static int smb3_reconfigure(struct fs_context *fc)
>  		ses->password = kstrdup(ctx->password, GFP_KERNEL);
>  		kfree_sensitive(ses->password2);
>  		ses->password2 = kstrdup(ctx->password2, GFP_KERNEL);
> +		if (!ses->password || !ses->password2)
> +			return ERR_PTR(rc);
>  	}
…

How do you think about to avoid also a memory leak here?

Regards,
Markus





[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux