From 7d088a3e4fab73d48c2a1315e54b25bc4a8f89b6 Mon Sep 17 00:00:00 2001 From: Quang Le Date: Fri, 29 Sep 2023 00:44:13 +0700 Subject: [PATCH] UPSTREAM: 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 Bug: 303146572 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 (cherry picked from commit f555a508087ab8210b4658120ac6413d6fe2b4c7) Signed-off-by: Lee Jones Change-Id: Iec1eb857124e3b6ffa6dbbeb5f796087a6194057 --- fs/cifs/fs_context.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/cifs/fs_context.c b/fs/cifs/fs_context.c index 89e810b27a4b..6bd713c6c869 100644 --- a/fs/cifs/fs_context.c +++ b/fs/cifs/fs_context.c @@ -1479,6 +1479,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; }