From: Quang Le Date: Thu, 28 Sep 2023 17:44:13 +0000 (+0700) Subject: fs/smb/client: Reset password pointer to NULL X-Git-Tag: v6.1.63~1042 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f555a508087ab8210b4658120ac6413d6fe2b4c7;p=sdk%2Femulator%2Femulator-kernel.git fs/smb/client: Reset password pointer to NULL commit e6e43b8aa7cd3c3af686caf0c2e11819a886d705 upstream. Forget to reset ctx->password to NULL will lead to bug like double free Cc: stable@vger.kernel.org Cc: Willy Tarreau Reviewed-by: Namjae Jeon Signed-off-by: Quang Le Signed-off-by: Steve French Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c index e2e2ef0fa9a0..f4818599c00a 100644 --- a/fs/smb/client/fs_context.c +++ b/fs/smb/client/fs_context.c @@ -1487,6 +1487,7 @@ static int smb3_fs_context_parse_param(struct fs_context *fc, cifs_parse_mount_err: kfree_sensitive(ctx->password); + ctx->password = NULL; return -EINVAL; }