From: Dan Carpenter Date: Tue, 27 Aug 2019 10:59:17 +0000 (+0300) Subject: cifs: Use kzfree() to zero out the password X-Git-Tag: v5.2.17~45 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=b8632186884a030da2cd83b2e02645e521ab2bbd;p=users%2Fdwmw2%2Flinux.git 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 Signed-off-by: Steve French Signed-off-by: Sasha Levin --- diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 2beaa14519f5d..85b2107e8a3d7 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -3081,7 +3081,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; }