summaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2019-08-27 13:59:17 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-09-21 07:17:04 +0200
commitb62946852afa136321dcaecbaf8d8abcf6638fed (patch)
tree2530a1992948fdace582a6ea5658b7d4c25456fd /fs/cifs
parent325fa2a6729b74b2806b31725940cb54658515e5 (diff)
downloadlinux-stable-b62946852afa136321dcaecbaf8d8abcf6638fed.tar.gz
linux-stable-b62946852afa136321dcaecbaf8d8abcf6638fed.tar.bz2
linux-stable-b62946852afa136321dcaecbaf8d8abcf6638fed.zip
cifs: Use kzfree() to zero out the password
[ Upstream commit 478228e57f81f6cb60798d54fc02a74ea7dd267e ] 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: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/connect.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 75727518b272..c290e231f918 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -2876,7 +2876,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;
}