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: [email protected]
Cc: Willy Tarreau <[email protected]>
Reviewed-by: Namjae Jeon <[email protected]>
Signed-off-by: Quang Le <[email protected]>
Signed-off-by: Steve French <[email protected]>
  • Loading branch information
quanglex97 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.