Commit 6fa2fa19 authored by Dan Carpenter's avatar Dan Carpenter Committed by Kleber Sacilotto de Souza

cifs: Use kzfree() to zero out the password

BugLink: https://bugs.launchpad.net/bugs/1845405

[ Upstream commit 478228e5 ]

It's safer to zero out the password so that it can never be disclosed.

Fixes: 0c219f5799c7 ("cifs: set domainName when a domain-key is used in multiuser")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 6df2a90f
......@@ -2583,7 +2583,7 @@ cifs_set_cifscreds(struct smb_vol *vol, struct cifs_ses *ses)
rc = -ENOMEM;
kfree(vol->username);
vol->username = NULL;
kfree(vol->password);
kzfree(vol->password);
vol->password = NULL;
goto out_key_put;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment