lkml.org 
[lkml]   [2019]   [Sep]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.9 60/74] cifs: Use kzfree() to zero out the password
    Date
    From: Dan Carpenter <dan.carpenter@oracle.com>

    [ 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>
    ---
    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 2a199f4b663bf..e43ba6db2bdd6 100644
    --- a/fs/cifs/connect.c
    +++ b/fs/cifs/connect.c
    @@ -2567,7 +2567,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


    \
     
     \ /
      Last update: 2019-09-20 00:21    [W:4.056 / U:0.612 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site