From: Markus Elfring <Markus.Elfring@web.de>
To: Haoxiang Li <make24@iscas.ac.cn>,
samba-technical@lists.samba.org, linux-cifs@vger.kernel.org,
kernel-janitors@vger.kernel.org,
Bharath SM <bharathsm@microsoft.com>,
Paulo Alcantara <pc@manguebit.com>,
Ronnie Sahlberg <ronniesahlberg@gmail.com>,
Shyam Prasad N <sprasad@microsoft.com>,
Steve French <sfrench@samba.org>, Tom Talpey <tom@talpey.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] fs: smb: client: Add missing check for kstrdup()
Date: Mon, 1 Jul 2024 15:01:15 +0200 [thread overview]
Message-ID: <5fecc08a-c3b7-4745-abc9-0f5b4de03c22@web.de> (raw)
In-Reply-To: <20240701064847.84726-1-make24@iscas.ac.cn>
> 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@iscas.ac.cn>
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
next prev parent reply other threads:[~2024-07-01 13:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-01 6:48 [PATCH] fs: smb: client: Add missing check for kstrdup() Haoxiang Li
2024-07-01 13:01 ` Markus Elfring [this message]
2024-10-22 17:15 ` [PATCH v2] fs_context.c: smb3_reconfigure: Handle kstrdup failures for passwords Henrique Carvalho
2024-10-22 18:21 ` [PATCH v3] smb: client: " Henrique Carvalho
2024-10-22 22:21 ` Steve French
2024-11-04 11:06 ` Markus Elfring
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-all 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=5fecc08a-c3b7-4745-abc9-0f5b4de03c22@web.de \
--to=markus.elfring@web.de \
--cc=bharathsm@microsoft.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=make24@iscas.ac.cn \
--cc=pc@manguebit.com \
--cc=ronniesahlberg@gmail.com \
--cc=samba-technical@lists.samba.org \
--cc=sfrench@samba.org \
--cc=sprasad@microsoft.com \
--cc=tom@talpey.com \
/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