Skip to content

Commit

Permalink
fs/smb/client: Reset password pointer to NULL
Browse files Browse the repository at this point in the history
Forget to reset ctx->password to NULL will lead to bug like double free

Cc: stable@vger.kernel.org
Cc: Willy Tarreau <w@1wt.eu>
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Quang Le <quanglex97@gmail.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
  • Loading branch information
Quang Le authored and Steve French committed Sep 28, 2023
1 parent 6465e26 commit e6e43b8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/smb/client/fs_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -1541,6 +1541,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;
}

Expand Down

0 comments on commit e6e43b8

Please sign in to comment.