linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cifs: Use kzfree() to zero out the password
@ 2019-08-27 10:59 Dan Carpenter
  2019-08-27 15:46 ` Steve French
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2019-08-27 10:59 UTC (permalink / raw)
  To: Steve French, Ronnie Sahlberg
  Cc: linux-cifs, samba-technical, kernel-janitors

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>
---
 fs/cifs/connect.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index e6cc5c4b0f19..642bbb5bee3a 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -3101,7 +3101,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;
 		}
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] cifs: Use kzfree() to zero out the password
  2019-08-27 10:59 [PATCH] cifs: Use kzfree() to zero out the password Dan Carpenter
@ 2019-08-27 15:46 ` Steve French
  0 siblings, 0 replies; 2+ messages in thread
From: Steve French @ 2019-08-27 15:46 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Steve French, Ronnie Sahlberg, CIFS, samba-technical, kernel-janitors

merged into cifs-2.6.git for-next

On Tue, Aug 27, 2019 at 6:02 AM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> 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>
> ---
>  fs/cifs/connect.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
> index e6cc5c4b0f19..642bbb5bee3a 100644
> --- a/fs/cifs/connect.c
> +++ b/fs/cifs/connect.c
> @@ -3101,7 +3101,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;
>                 }
> --
> 2.20.1
>


-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-08-27 15:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-27 10:59 [PATCH] cifs: Use kzfree() to zero out the password Dan Carpenter
2019-08-27 15:46 ` Steve French

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).